On Lunes, 22 de Junio de 2009 14:14:38 BaSS escribió:
> Hombre un amigo maño :)
>
> > The link should be something like
> > /interfaces/new?parent_id=interface_id&parent_column=device&parent_model=
> >Interface
>
> yes, right now is like that
>
> > In the form you shouldn't have fields for interface association.
> >
> > I'm working in change nested scaffolds url to use nested routes in
> > experimental branch.
>
> nice, so meanwhile what is the best strategy to block acsess directly
> to "interface" scaffold but not block AS?

The best way (or only way) is redirect or raise an exception with a before 
filter when request is not for a nested form/scaffold.

before_filter proc{|controller|
        controller.redirect_to root_path unless 
controller.params[:parent_controller]
}

Change root_path with the path you want to redirect to. Or change redirect_to 
with a raise exception (raise ActiveScaffold::ActionNotAllowed for example)
-- 
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