On Viernes, 19 de Junio de 2009 11:45:17 jalberto escribió:
> Hola,
>
> i have to scaffolds: devices and interfaces both are related in that
> way:
> devices has_many interfaces, interfaces belongs_to devices
>
> I access the table in /devices/ so i can add new devices and
> interfaces but i can access too /interfaces/new,etc
>
> How can i block that? i only want to add "interfaces" from /devices

You can add a before_filter to check access is requested via nested scaffold:
before_filter proc{|controller| controller.redirect_to root_url unless 
controller.params[:parent_controller]}
-- 
Sergio Cambra .:: entreCables S.L. ::.
Nicolás Guillén 6, locales 2 y 3. 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) [email protected]


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to