What is the first step you are describing here .. ?
i did not get it properly .. ?
Älphä Blüë wrote:
Hemant Bhargava wrote:
Hi Champs,
Need Help ..
Actually the thing is that i am having many controllers a, b, c and d..
But what i want it that only "a" should be displayed to the users .. b,
c, d not ..
Is there any way to do it .. ?
Cheers ..
Yes, you can do this a couple of ways..
The first way is you can inhibit the routing of controllers you don't
want people to access by doing something similar:
These two lines basically setup the controller, action, id routing to
every controller you create. If you don't want these to manage those
routes you need to comment them out:
Then, you setup explicit routing using the examples I gave. If you are
having trouble with routes then you need to research them a bit and get
familiar with them. They are very important for working with rails:
quite interesting problem
I think best way to add :before_filter to your controllers
routing will restrict even the admin level user to access the
controllers.
if you want to restrict all users including the admin then you have to
think how
can you access that controller from the internal system (because if
you are
using restful routing and have not define anything for that controller
then you will not be able to
access those controller. in that case you have to rethink about the
design i mean whether you really need those controllers)
if this one is the authorization problem then :before_filter is the
best solution