REST Cheatsheet
REST Cheatsheet
REST Cheatsheet
rb)
Simple
de
Nested
p C o
Pee
teams.resources :players
end
Customized
map.resources :articles,
:collection => {:sort => :put},
:member => {:deactivate => :delete},
:new => {:preview => :post}, REST Screencast $9 at http://peepcode.com
:controller => 'articles',
:singular => 'article', 85 minutes of RESTful goodness
:path_prefix => '/book/:book_id',
:name_prefix => 'book_'
Including the default route (/:controller/:action/:id) will allow any verb to access any action. This is usually
not what you want, so you should probably delete it from routes.rb
button_to "Destroy", team_path(@team), :confirm => "Are you sure?", :method => :delete
link_to "Destroy", team_path(@team), :confirm => "Are you sure?", :method => :delete
link_to_remote "Destroy", :url => team_path(@team), :confirm => "Are you sure?", :method => :delete
form_for :team, @team, :url => team_path(@team), :html => { :method => :put } do |f| ...
respond_to { |wants| wants.all | .text | .html | .js | .ics | .xml | .rss | .atom | .yaml }