シングルトン・リソースについて
リソースの集合ではないシングルトン・リソース/somethingをroutes.rbで以下のように宣言したとき,
map.resource :something
実際にリクエストをハンドルするコントローラはデフォルトでSomethingsController(複数形).
rake routesするとどうマップされてるか一目瞭然.
% rake routes (in /Somewhere) POST /something {:action=>"create", :controller=>"somethings"} POST /something.:format {:action=>"create", :controller=>"somethings"} new_something GET /something/new {:action=>"new", :controller=>"somethings"} formatted_new_something GET /something/new.:format {:action=>"new", :controller=>"somethings"} edit_something GET /something/edit {:action=>"edit", :controller=>"somethings"} formatted_edit_something GET /something/edit.:format {:action=>"edit", :controller=>"somethings"} something GET /something {:action=>"show", :controller=>"somethings"} formatted_something GET /something.:format {:action=>"show", :controller=>"somethings"} PUT /something {:action=>"update", :controller=>"somethings"} PUT /something.:format {:action=>"update", :controller=>"somethings"} DELETE /something {:action=>"destroy", :controller=>"somethings"} DELETE /something.:format {:action=>"destroy", :controller=>"somethings"} /:controller/:action/:id /:controller/:action/:id.:format
map.resourcesとは違い,indexのルートは作られない.http://api.rubyonrails.com/classes/ActionController/Resources.html#M000697を参照.