On Jueves, 3 de Diciembre de 2009 13:13:39 johnnybutler7 escribió: > Thanks for advice guys. > > I added the following below to the on_create.rjs file so the > javascript redirects it for me. > > page.redirect_to main_url >
You shouldn't overwrite ActiveScaffold files or you can lose your changes if you update the plugin. Create a on_create.js.rjs file in the views directory of your controller, or create it in app/views/active_scaffold_overrides if you want override it for all controllers. > JB > > On 3 Dec, 10:55, "Sergio Cambra .:: entreCables S.L. ::." > > <[email protected]> wrote: > > On Jueves, 3 de Diciembre de 2009 11:45:49 [email protected] escribió: > > > hi > > > > > > you may overwrite create in your controller e.g. > > > > > > def create > > > do_create > > > redirect_to <<dest_path>> > > > end > > > > > > but maybe there is a better way to do it > > > ahmed > > > > The way is override create_respond_to_#{type} in the controller: > > create_respond_to_html > > create_respond_to_js > > > > > On 3 Dez., 11:39, johnnybutler7 <[email protected]> wrote: > > > > Hi, > > > > > > > > Is there an esay way to redirect to another controller after creating > > > > a record. Obvously once the record is saved the javascript is called > > > > to close the form down and render the list again. > > > > > > > > What i want is to completly redirect to a new url, so something like: > > > > > > > > def after_create_save(record) > > > > redirect_to main_url > > > > end > > > > > > > > I get a cannot double render or redirect error......... > > > > > > > > I know i need to overwrite something but not sure where is best, > > > > > > > > JB > > > > > > -- > > > > > > 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. > > > > -- > > 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. -- 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.
