Ruby on Rails routes - difference between get and match

What is the difference?

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

Get example:
get 'photos/show'

Could you reach the image / show url as well as use the show action in the photo controller?

thank

+62
ruby-on-rails ruby-on-rails-3
Aug 08 '11 at 21:30
source share
1 answer

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

The following two equivalents:

 match "/signup" => "users#new", :via => [:get] get "/signup" => "users#new" 
+121
Aug 08 2018-11-18T00:
source share



All Articles