最終更新:2019-06-18 (火) 22:08:54 (90d)  

Rails/resources はてなブックマークを見る
Top / Rails / resources

RESTfulなURLを自動生成

resources :リソース名 [, オプション]

http://railsdoc.com/references/resources

Rails/アクション

Rails/パス
GET/articlesRails/アクション/index?articles_path
POST/articlesRails/アクション/create?
GET/articles/newRails/アクション/new?new_article_path
GET/articles/:id/editRails/アクション/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]