0
我有這個在我的routes.rb資源可用輸出父資源軌3.2
resources :users, :path => "/", :only => [:show] do
resources :collections, :controller => 'users/collections'
end
爲什麼我訪問館藏資源來自:如果這種源這裏面用戶
http://localhost:3000/en/collections
?
我想這collection resource
唯一就是使內部:
http://localhost:3000/en/users/collections
這是我的路線:
user_collections GET (/:locale)/:user_id/collections(.:format) users/collections#index
POST (/:locale)/:user_id/collections(.:format) users/collections#create
new_user_collection GET (/:locale)/:user_id/collections/new(.:format) users/collections#new
edit_user_collection GET (/:locale)/:user_id/collections/:id/edit(.:format) users/collections#edit
user_collection GET (/:locale)/:user_id/collections/:id(.:format) users/collections#show
PUT (/:locale)/:user_id/collections/:id(.:format) users/collections#update
DELETE (/:locale)/:user_id/collections/:id(.:format) users/collections#destroy
我該怎麼辦呢?
謝謝
你重新更改路線後,您的應用程序? – jdoe
是的,我在更改路由後重新啓動了服務器。我正在使用rails 3.2。 – hyperrjas
你需要那個:path =>「/」? – Anil