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
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.
Thanks in advance,