Ruby on Rails Routes - difference between get and match

Ruby on-RailsRuby on-Rails-3

Ruby on-Rails Problem Overview


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

Ruby on-Rails Solutions


Solution 1 - Ruby on-Rails

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"

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionEverTheLearnerView Question on Stackoverflow
Solution 1 - Ruby on-RailsrubishView Answer on Stackoverflow