You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ruby on Rails: Talk
The default verb for match is :any. This means for:
match 'dog/bark(/:num)' => 'dogs#bark' # get 3 barks
match 'dog/eat' => 'dogs#eat' # post breakfast
someone could post on dog/bark with :louder or get on dog/eat
with :breakfast. This is annoying and messy, and definitely not
RESTful.
In moving to Rails 3, I'm finding it better to use the verb instead of
using match with :via => :verb:
get 'dog/bark' => 'dogs#bark'
post 'dog/eat' => 'dogs#eat'
There is a lot of emphasis on match in the routing comments. Wouldn't
it be better to either default to :via => :get for match or recommend
verb methods over the match method?
I want to make sure I understand the differences too.