概要
Railsの画面遷移について。
前提
Hello Railsを動的に出力まで設定済みであること
内容
goodbyeページを用意します。
say_controller.rbのgoodbyeメソッドを以下のように修正
def goodbye @message="Goodbye Rails "*5 end
goodbye.html.erbを以下のように設定
<h1 id="goodbye"><%=@message%></h1>
hello.html.erbを以下のように修正
<h1 id="hello"><%=@message%></h1> <a href="/say/goodbye">goodbye railsへ</a>