以下のページを参照してHomeページを作成しておく。
https://qiita.com/classe729/items/a7c3bbafb58d421bd586
Aboutページの動作を追加する。
まずは以下の通りになるよう修正する。
app/controllers/static_pages_controller.rb
class StaticPagesController < ApplicationController
def home
end
def help
end
def about
end
end
Aboutページの転送先を追加する。
app/views/static_pages/about.html.erb
<h1>About</h1>
<p>
<a href="https://railstutorial.jp/">Ruby on Rails Tutorial</a>
is a <a href="https://railstutorial.jp/#ebook">book</a> and
<a href="https://railstutorial.jp/#screencast">screencast</a>
to teach web development with
<a href="http://rubyonrails.org/">Ruby on Rails</a>.
This is the sample application for the tutorial.
</p>
http://XXX.XXX.XXX.XXX:3000/static_pages/about
にアクセスすると以下のようなページが出力される。
次いでcontact pageも作成する。
app/views/static_pages/contact.html.erb
<% provide(:title, "Contact") %>
<h1>Contact</h1>
<p>
Contact the Ruby on Rails Tutorial about the sample app at the
<a href="http://www.railstutorial.org/#contact">contact page</a>.
</p>