5 ms·
You can simply write post instead of match to require a POST request.
by spicyj 15y ago
You can simply write post instead of match to require a POST request.
- uxp 15y agoYou can use most all of the verbs: 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 ... end