Actually I don’t understand how to correctly handle this. I have a situation where news could be managed with admin/edit admin/show admin/news… and similar paths, however I want to give users a page called news/show/1, because actually my news resources are routed under “admin” namespace, how should I handle the fact that I need to bind news routes outside “admin” namespace?
Actually I have only this:
namespace :admin do
resources :news
end
My Idea:
namespace :admin do
resources :news
end
resources :news
Then I’ll have:
- app/controllers/admin/news_controller.rb
- app/controllers/news_controller.rb
Is this correct?
Seeing your answer, I can suggest more simpler routes.
If you want
indexaction too, rewrite the last line as:You won’t need the helper for
news_pathandnews_url. You will get them already built for you.