Sha256: 5674239641dabbbf56236cb8019b663c5f2a465f79f06dfb1c2cee5e827b82c9

Contents?: true

Size: 917 Bytes

Versions: 3

Compression:

Stored size: 917 Bytes

Contents

<%% if @<%= instance_name %>.errors.blank? %>
	
	// Fill the right box with first item details
  $('#div_<%= instance_name %>_details').html("<%%= escape_javascript(render(:partial=>"show")) %>");
	
	// Refresh the updated item in the list
  $("#div_<%= instance_name %>_<%%= @<%= instance_name %>.id %>").html("<%%= escape_javascript(render :partial => 'item', :locals => { :<%= instance_name %> => @<%= instance_name %> }) %>")
  
  // Close Modal
  closeModal();

<%% else %>
	
  // Show the new form in the pop up form.
  heading = "Edit <%= model_class.titleize %>";
  bodyContent = "<%%= escape_javascript(render(:partial=>"form")) %>";
  showModal(heading, bodyContent);
  validate<%= model_class %>Form();
  
  // Populate Server Side Errors
  errorMessages = <%%= @<%= instance_name %>.errors.full_messages.to_json.html_safe %>;
  populateServerSideErrors('<%= instance_name %>', errorMessages);

<%% end %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
humdrum-rails-0.1.3 lib/rails/generators/humdrum/resource/templates/views/bootstrap3/resource/update.js.erb
humdrum-rails-0.1.2 lib/rails/generators/humdrum/resource/templates/views/bootstrap3/resource/update.js.erb
humdrum-rails-0.1.1 lib/rails/generators/humdrum/resource/templates/views/bootstrap3/resource/update.js.erb