73
votes

What would the difference be?

Example Match:
match 'photos/show' => 'photos#show'

Example Get:
get 'photos/show'

Wouldn't both make it possible to reach the photos/show URL and also use the show action in the photos controller?

Thanks

1

1 Answers

132
votes

match matches any http method/verb, while get matches only http method/verb GET.

Following two are equivalent:

match "/signup" => "users#new", :via => [:get]
get   "/signup" => "users#new"