Rails 3: Set a route as 'get'
I have a route as:
match 'api/v1/:id/:format/:date/(:type)', :controller => "xpto", :action => "api_开发者_开发技巧xpto"
The goal is to make it as a GET request from the outside. However, the route is not being set as a GET.
How can I make it a GET?
Change match to get:
get 'api/v1/:id/:format/:date/(:type)', :controller => "xpto", :action => "api_xpto"
Or add :via option
match 'api/v1/:id/:format/:date/(:type)', :controller => "xpto", :action => "api_xpto", :via => :get
精彩评论