LoginSignup
1
0

More than 3 years have passed since last update.

学んだこと

Last updated at Posted at 2019-11-21

「show」アクションや「edit」アクションのように「id」パラメータを指定して呼び出すアクションの場合は、モデルオブジェクト(下記では@blog変数に格納されている)を使って次のように記述します。

<%= link_to 'Show Page', blog_path(@blog) %>
<%= link_to 'Edit Page', edit_blog_path(@blog) %>

三項演算子とは

if 条件式
A
else            =>      条件式 ? A:B
B
end

に省略できる

1
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0