form_selector = "#{element_form_id(:action => :update)}" page << "var action_link = ActiveScaffold.find_action_link('#{form_selector}');" page << "action_link.update_flash_messages('#{escape_javascript(render(:partial => 'messages').strip)}');" if controller.send :successful? if render_parent? && controller.respond_to?(:render_component_into_view) parent_rendered = controller.send(:render_component_into_view, render_parent_options) if nested_singular_association? page << "action_link.close('#{escape_javascript(parent_rendered)}');" else if render_parent_action == :row page << "action_link.close('#{escape_javascript(parent_rendered)}');" elsif render_parent_action == :index page << parent_rendered end end #page.call 'ActiveScaffold.replace', active_scaffold_calculations_id, render(:partial => 'list_calculations') if active_scaffold_config.list.columns.any? {|c| c.calculation?} elsif update_refresh_list? page.call 'ActiveScaffold.replace_html', active_scaffold_content_id, render(:partial => 'list', :layout => false) else updated_row = render :partial => 'list_record', :locals => {:record => @record} page << "action_link.close('#{escape_javascript(updated_row)}');" page.call 'ActiveScaffold.replace', active_scaffold_calculations_id, render(:partial => 'list_calculations') if active_scaffold_config.list.columns.any? {|c| c.calculation?} end else page.call 'ActiveScaffold.replace', form_selector, render(:partial => 'update_form', :locals => {:xhr => true}) page.call 'ActiveScaffold.scroll_to', form_selector end