On Jueves, 15 de Abril de 2010 17:05:11 cschlaefcke escribió: > Thanks for the reply! Actually I have no clue how to do that :-( > > Can you point me to an example?
If you want to open a div with some HTML: controller.rb: active_scaffold do |config| [...] config.action_links.add 'action_name', :label => 'text', :type => :member, :inline => true [...] end def action_name [some code] end action_name.html.erb: [view in HTML] If you don't want to open an HTML view: controller.rb: active_scaffold do |config| [...] config.action_links.add 'action_name', :label => 'text', :type => :member, :inline => true, :position => false [...] end def action_name [some code] render :nothing => true end If you want to update the view with JS, remove the render :nothing => true and add a view: action_name.js.rjs: [RJS to update the view] I can't put RJS code because I don't know what you want to get > > Regards, > > Christian > > > On 15 Apr., 12:28, "Sergio Cambra .:: entreCables S.L. ::." > > <[email protected]> wrote: > > On Miércoles, 14 de Abril de 2010 18:19:38 cschlaefcke escribió: > > > Hi Folks, > > > > > > I am trying to find a way of preserving the current view (multiple > > > collapsed associations) after an user performed an application_links > > > action (:record => true) on one of the nested associations. > > > > > > At the moment I try to achieve it by passing the http_referer request > > > param to the view/erb. I store it as a hidden field and pass it back > > > again when the post action got triggered. Then I call > > > "redirect_to :controller => referer_klazz.intern, :action => :index" > > > > > > This actually prevents the user from getting redirected to the nested > > > controller but the previous view got lost which isn´t quite handy as > > > well. > > > > > > I wonder if there is a better way then using "redirect_to" with which > > > I can achieve my requirement. > > > > Then only way I know is to use an action link with :inline true, so you > > get an AJAX request, then you must build a JS response > > > > -- > > 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.
