Using routes to replace controllers in namespace

Hi all-

I am adding an admin console to my application and I would like to have
URLs such as /admin/customer to access the CustomerController. Per
this article
(http://glu.ttono.us/articles/2006/08/30/guide-things-you-shouldnt-be-doing-in-rails),
it is not a best practice to put a contoller in a namespace (e.g.
Admin::CustomerController). I understand how to route requests such as
/admin/customer to the CustomerController, but how do I stop user from
accessing the CustomerController directly (e.g. via /customer)? It
seems that I might be able to do this via routes, but I have not been
able to find it.

Thanks,
Josh

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs