On Martes, 19 de Octubre de 2010 18:29:37 Iñaki Baz Castillo escribió:
> Hi, with "config.create.link = false" in a controller ChildsController
> I avoid the list view of such controller to show the button "Create
> New" (which is what I want).
>
> However the model Parent has_many :childs and I want to enable the
> "Create New" button in the nested view of Childs under Parent list
> view. This is, when showing the list view of Parents and clicking on
> Childs column I get the netsted list view of Childs associated to this
> Parent, and I want such nested view to show the "Create new" button,
> but this button must not be shown when viewing the list view of Childs
> controller.
>
> Is it possible?
Yes, don't set create.link to false, and override create_authorized?:
def create_authorized?
nested? ? super : false
end
If you don't need to check security in the model, you can return nested?:
def create_authorized?
nested?
end
--
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.