form_selector = "#{element_form_id(:action => :batch_update)}" if controller.send :batch_successful? page.call 'ActiveScaffold.replace_html', active_scaffold_content_id, render(:partial => 'list', :layout => false) page << "ActiveScaffold.find_action_link('#{form_selector}').close();" else page << "ActiveScaffold.find_action_link('#{form_selector}').update_flash_messages('#{escape_javascript(render(:partial => 'messages').strip)}');" page.call 'ActiveScaffold.replace', form_selector, render(:partial => 'batch_update_form', :locals => {:xhr => true}) page.call 'ActiveScaffold.scroll_to', form_selector end