LoginSignup
0
0

More than 1 year has passed since last update.

resources :column_name 

Posted at

7つのアクションを自動で設定してくれるroutes:column_name

get '/users/new', to: 'users#new'
の書き方で一つ一つ設定しても良いが、レールを準備してくれている。

さらに必要なアクションを指定する方法があり、以下の通り

resources :リソース名 :only => :アクション名
resources :リソース名 :only => [:アクション名, :アクション名, ...]

不要なアクションを指定する方法は以下の通り、

resources :リソース名 :except => :アクション名
resources :リソース名 :except => [:アクション名, :アクション名, ...]

rails routesで確認すれば、routeやpathを一覧で確認できる。

0
0
0

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