Sha256: 8ca31276d4ec29a112be986a842f16d5566c1d199e41d591c5749b078806848f

Contents?: true

Size: 1.45 KB

Versions: 3

Compression:

Stored size: 1.45 KB

Contents

<% if successful? %>
  <% if @record %>
    <%= render :partial => 'update_messages' %>
    <% row = escape_javascript(render(:partial => 'list_record', :locals => {:record => @record})) -%>
    <% if @action_link.try(:position) %>
      ActiveScaffold.find_action_link('<%= element_form_id(:action => action_name) %>').close('<%= row %>');
    <% else %>
      ActiveScaffold.update_row('<%= element_row_id(:action => :list, :id => @record.id) %>', '<%= row %>');
      ActiveScaffold.scroll_to('<%= element_row_id(:action => :list, :id => @record.id) %>', true);
    <% end %>
    <%= render :partial => 'update_calculations', :formats => [:js] %>
  <% else %>
    <% if @action_link.try(:position) %>
      ActiveScaffold.find_action_link('<%= element_row_id(:action => action_name) %>').close();
    <% end %>
    <%= render :partial => 'refresh_list' %>
  <% end %>
<% else %>
  <% flash[:error] = active_scaffold_error_messages_for(@record, :object_name => "#{@record.class.model_name.human.downcase}#{@record.new_record? ? '' : ": #{@record.to_label}"}", :header_message => '', :message => "#{@record.class.model_name.human.downcase}#{@record.new_record? ? '' : ": #{@record.to_label}"}", :container_tag => nil, :list_type => :br) if @record.try(:errors).present? %>
  ActiveScaffold.replace_html('<%= active_scaffold_messages_id %>','<%= escape_javascript(render(:partial => 'messages')) %>');
  ActiveScaffold.scroll_to('<%= active_scaffold_messages_id %>', true);
<% end %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
active_scaffold-3.4.4 app/views/active_scaffold_overrides/on_action_update.js.erb
active_scaffold-3.4.3 app/views/active_scaffold_overrides/on_action_update.js.erb
active_scaffold-3.4.2 app/views/active_scaffold_overrides/on_action_update.js.erb