在我的routes.rb我:遺傳資源:與航線資源嵌套
resources :fire_preventions do
get 'search_adv', :on => :collection
end
我如何使用它與遺傳資源的路線?
search_adv_collection_url不起作用。
在我的routes.rb我:遺傳資源:與航線資源嵌套
resources :fire_preventions do
get 'search_adv', :on => :collection
end
我如何使用它與遺傳資源的路線?
search_adv_collection_url不起作用。
由於只有一個路由上市,
resources :fire_preventions do
get 'search_adv', :on => :collection
end
是縮短形式爲擺脫附加塊
resources :fire_preventions do
collection do
get 'search_adv'
end
end
您應該能夠使用search_adv_fire_preventions_path
和search_adv_fire_preventions_url
的。最好你執行rake routes
來檢查這一點。
search_adv_fire_preventions_url工程,但我想使用從繼承資源的url助手和search_adv_collection_url不起作用。 – Mauro 2011-05-11 11:11:30
你看過這些[示例](https://github.com/josevalim/inherited_resources)嗎?似乎'collection_url'幫手是上下文敏感的。另外,如果你還沒有看到這個[screencast](http://asciicasts.com/episodes/230-inherited-resources)。 – 2011-05-11 11:28:50
解決了:search_adv_resources_url – Mauro 2011-05-11 11:39:37