On Jueves, 15 de Abril de 2010 01:40:45 Soren Christensen escribió:
> Hi,
>
> I know how to build various action links to extend the functionality of
> AS, but this time I need something that is a bit more.
>
> I need to have an action link be the UI trigger.
> I would like to have a pop-up window appear, in which the system
> proposes a NEW record to be created, but with a number of the fields
> already populated - similar to the regular do_new function in a controller.
>
> Is there a way to this using the AS components or do I have to write my
> own create method in the controller and my own view method to present
> the data - and treat this as any other form that is posting data to the
> database in the standard rails fashion.
You can create a new action in the controller (for example a suggest action)
to show the form using the create view:
def suggest
@record = active_scaffold_config.model.new :column1 => value1, :column2
=>
value2
respond_to_action(:new)
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.