最終更新:2019-06-18 (火) 22:08:54 (1735d)
Rails/resources
RESTfulなURLを自動生成
resources :リソース名 [, オプション]
http://railsdoc.com/references/resources
Rails/アクション
Rails/パス | |||
GET | /articles | Rails/アクション/index? | articles_path |
POST | /articles | Rails/アクション/create? | |
GET | /articles/new | Rails/アクション/new? | new_article_path |
GET | /articles/:id/edit | Rails/アクション/edit? | edit_article_path |
GET | /articles/:id/ | Rails/アクション/show? | article_path |
PATCH | /articles/:id/ | Rails/アクション/update? | |
PUT | /articles/:id/ | Rails/アクション/update? | |
DELETE | /articles/:id/ | Rails/アクション/destroy? |
メモ
- resources :brands, only: [:index, :show]