by mnutt · 14y ago · 0 comments
get '/foo' => 'foos#index', as: :foo
post '/foo' => 'foos#new', as: :new_foo
get '/foo/:id' => 'foos#show', as: :show_foo
put '/foo/:id' => 'foos#edit', as: :edit_foo
delete '/foo/:id' => 'foos#destroy', as: :destroy_foo
or scope them if you'd like: scope controller: "foo", constraints: { id: /0-9]+/ } do
get '/foo' => :index, as: :foo
post '/foo' => :new, as: :new_foo
put ...
delete ...
endAnd, again! PLEASE use method "data" instead of match :via => method. It's much better and looks clean.