Post Meta

Bookmarks

  • Delicious
  • Digg
  • Reddit
  • Magnolia
  • Newsvine
  • Furl
  • Facebook
  • Technorati

This refresh button will update only the table itself via an Ajax call.


Add a custom action link into your controller, or, if you want to make refresh generally available for all your AS-managed tables, add the custom action in the global AS config section in application.rb.

# adding the refresh button
config.action_links.add('refresh', :label => l(:active_scaffold, :refresh), :inline => true, :position => false)

Then add the refresh method either in the controller or in a generally available helper (if you’ve added the action link in the global AS config)

def refresh
    p = params[:controller]
    render :update do |page|
      page["#{p}-active-scaffold"].replace_html render_component(:controller => p)
    end unless p.nil?   
  end


Related posts

Leave A Comment

+ -