On Martes, 4 de Mayo de 2010 19:00:45 Soren escribió: > Finally got time to play with this. Works great. > > Now next step - I tried to extend this into a specialized edit method. > I still need the regular edit so I assume that I should not overwrite > the do_edit. > > So I wrote this little piece to try it out: > def submitted > @record = beginning_of_chain.find(params[:id]) > > @record.status = ... > @record.approve_date = Time.now > @record.age = -1 > > respond_to_action(:edit) > end > > Which works almost as I want it - except that the value that I have > defined in @record does not get set in the edit form. > > what did I miss ?
I have tried it and it's working using submitted action. Are you sure you are invoking submitted action? > > Also - what other actions can you use in respond_to_action ? You can look at lib/active_scaffold/actions/*.rb files > > /S > > > On Apr 15, 3:46 am, "Sergio Cambra .:: entreCables S.L. ::." > > <[email protected]> wrote: > > 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] -- 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.
