1
我有一個路線:的Rails 3:設置路徑爲「得到」
match 'api/v1/:id/:format/:date/(:type)', :controller => "xpto", :action => "api_xpto"
的目標是讓它從外面的GET請求。但是,該路由不會被設置爲GET。
我該如何讓它成爲GET?
我有一個路線:的Rails 3:設置路徑爲「得到」
match 'api/v1/:id/:format/:date/(:type)', :controller => "xpto", :action => "api_xpto"
的目標是讓它從外面的GET請求。但是,該路由不會被設置爲GET。
我該如何讓它成爲GET?
變化比賽到得到:通過選項
match 'api/v1/:id/:format/:date/(:type)', :controller => "xpto", :action => "api_xpto", :via => :get
實際上,':
或者添加as'用於命名路線。正確的選項是':via =>:get' – bassneck 2011-05-11 13:23:14
謝謝,寫得太快了。編輯。 – iceydee 2011-05-11 13:24:38