You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
2.2 KiB

<%# show errors in nested %>
12 years ago
<% messages_id ||= nested? ? "as_users__domains-#{nested.parent_id}-users__records-messages" : active_scaffold_messages_id -%>
<% if controller.send(:successful?) %>
<% if render_parent? %>
<% if render_parent_action == :row %>
<%# TODO: That s not working with delete.... %>
<% current_id = controller_id(params[:eid] || params[:parent_sti]) -%>
ActiveScaffold.delete_record_row('<%= element_row_id(:controller_id => current_id, :action => 'list', :id => params[:id]) %>', '<%= url_for(params_for(:action => :index, :id => nil, :page => [active_scaffold_config.list.user.page.to_i - 1, 1].max)) %>');
<% messages_id = active_scaffold_messages_id(:controller_id => current_id) %>
<%= render :partial => 'update_calculations', :locals => {:calculations_id => active_scaffold_calculations_id(:controller_id => current_id)}, :formats => [:js] %>
<% elsif render_parent_action == :index %>
<% if controller.respond_to?(:render_component_into_view) %>
<%= escape_javascript(controller.send(:render_component_into_view, render_parent_options)) %>
<% else %>
ActiveScaffold.reload('<%= url_for render_parent_options %>');
<% end %>
<% end %>
<% elsif (active_scaffold_config.delete.refresh_list) %>
<%= render :partial => 'refresh_list' %>
<% else %>
12 years ago
<% row_id = "as_users__domains-#{nested.parent_id}-users__records-list-#{params[:id]}-row" %>
ActiveScaffold.delete_record_row('<%= row_id %>', '<%= url_for(params_for(:action => :index, :id => nil, :page => [active_scaffold_config.list.user.page.to_i - 1, 1].max)) %>');
<%= render :partial => 'update_calculations', :formats => [:js] %>
<% end %>
<% elsif flash[:error].blank? %>
<% 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) %>
<% end %>
<%= render :partial => 'update_messages', :locals => {:messages_id => messages_id} %>