On Lunes, 22 de Junio de 2009 22:19:36 BaSS escribió:
> > before_filter proc{|controller|
> > controller.redirect_to root_path unless
> > controller.params[:parent_controller]
> >
> > }
>
> first thanks for your help (i'm a rails newbie), but it doenst works
> here. If i put that exactly in interfaces_controller i get this:
>
> undefined local variable or method `root_path' for
> InterfacesController:Class
I suppose you haven't defined the root path in your routes.rb:
config.root :controller => 'ControllerName'
If you want to redirect to an url, you can change root_path with the url you
want ('/', '/devices' or controller.devices_path for example)
before_filter proc{|controller|
controller.redirect_to controller.device_path unless
controller.params[:parent_controller]
}
>
> doesnt matter if i use root_path or :devices (for example). If i try
> to raise an exception i get:
>
> private method `raise' called for #<InterfacesController:0xb7485050>
You shouldn't use raise as a controller method (controller.raise), use only
raise:
before_filter proc{|controller|
raise ActiveScaffold::ActionNotAllowed unless
controller.params[:parent_controller]
}
>
> Any idea?
>
--
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 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
-~----------~----~----~----~------~----~------~--~---