我在我的routes.rb中有这个。
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
我该怎么做?
谢谢
答案 0 :(得分:0)
试试这个:
resources :users, :only => [:show] do
resources :collections, :controller => 'users/collections'
end