Sha256: 2718a5baf82b08cb0daae5854e95328bfdda81357ec4ad942a7de8429f3da626

Contents?: true

Size: 714 Bytes

Versions: 2

Compression:

Stored size: 714 Bytes

Contents

<%= remotipart_response do %>
  <% unless @comment.errors.any? %>
    $('#comments').append( '<%= escape_javascript(
      render @comment
    ) %>' );
    $('#new-comment-form-container').find('input:not(:submit),select,textarea').val('');
    <% if request.put? %>
        $('#comments').after('PUT request!');
    <% end %>
  <% else %>
    var $form = $('#new_comment'),
        $errorDiv = $('<div id="error_explanation">'),
        $errorList = $('<ul>');
    <% @comment.errors.full_messages.each do |msg| %>
      $errorList.append('<li><%= escape_javascript msg %></li>');
    <% end %>
    $form.find('#error_explanation').remove();
    $form.prepend($errorDiv.append($errorList));
  <% end %>
<% end %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
remotipart-1.4.4 spec/dummy_app/app/views/comments/create.js.erb
remotipart-1.4.3 spec/dummy_app/app/views/comments/create.js.erb