开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜