Bootstrap modal form is committing twice
问题 I have a modal form: <div id="commentModal" class="modal hide fade"> <div class="modal-body"> <%= form_for(Comment.new, remote: true, html: {"data-type" => :json}, :validate => true) do |f| %> <%= f.hidden_field(:illustration_id, :value => @illustration.id) %> <%= f.hidden_field(:user_id, :value => current_user.id) %> <%= f.text_area(:comment, :id => "comment_message") %> <%= f.submit "Submit", :class => 'btn btn-custom-primary' %> <% end %> </div> </div> When I submit the comment is added to