LoginSignup
0
0

More than 3 years have passed since last update.

コントローラー、ルーティングの同時作成

Posted at

'''
rails g controller 作成したいコントローラー名 index

・コントローラー作成時に、コントローラー名に続けてアクション名を指定。
これにより、コントローラーの作成だけでなく。

messagesコントローラーにindexアクションが作られる。
viewsのmessagesフォルダにindex.html.erbファイルが作られる。

・ルートパスをルーティングに記述する。
root to:"コントローラー名#アクション名"

0
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
0
0