I have this scope:
scope ":user_id", :as => "user" do
resources :boards, :controller => 'users/boards'
end
I get this route:
http://localhost/hyperrjas/boards/
I want a url without boards then on routes.rb I add:
scope ":user_id", :as => "user" do
resources :boards, :controller => 'users/boards', :path => '/'
end
That works great, but it is still accessible via “/boards” … How do I prevent that? (I’m using Rails 3.1)
You shouldn’t have to specify the controller names when using resources and in this caseI would use nested resources:
This should give you the following:
and of course your restful routes!