On Jueves, 13 de Mayo de 2010 16:30:18 Iñaki Baz Castillo escribió:
> 2010/5/13 Iñaki Baz Castillo <[email protected]>:
> > Humm, it's enough to use "params[:id]"  :)
>
> Ok, I've got it, except a detail:
>
> This member action_link modifies the content of the member so I need
> that, after executing the action, the row is reloaded via AJAX.
>
> With my current code it's not done:
>
>
>     config.action_links.add :empty,
>
>                             :label => "Vaciar", :type => :member,
>                             :inline => true, :position => :replace,
> :
> :crud_type => :update
>
>   def empty
>     list.description = nil
>     list.save
>     flash[:info] = "Reseteado"
>     render :update do |page|
>       page.replace_html active_scaffold_messages_id, :partial => "messages"
>     end
>   end
>
>
> Could I get some help on how I must use the 'render' in order to
> update the row according to the new data?

There is a view to refresh a row, replace your render with this:
  respond_to do |format|
    format.html { redirect_to :action => :index}
    format.js { render :action => 'update_row' }
  end

Or you can put only "render :action => 'update_row'" if you only want to 
respond to AJAX requests


-- 
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.

Reply via email to