Saturday, 15 February 2014

javascript - Ruby On Rails Ajax Submit submitting twice -


So I decided to create a blog in ROR and all are good and I did get comments and not what to do, but When I am commented, when the comment is posted, then click on "Update" to allow "Update" to allow the page not to be refreshed (AJAX), but now whenever I have any comments on pages for any reason I'm going to post, at the same time Only two comments that appear in the message.

  & lt; H2 & gt; Comments & lt; / H2 & gt; & Lt; Div id = "comment" & gt; & Lt;% = Render: Partial = & gt; @ Post.comments% & gt; & Lt; / Div & gt; & Lt;% = form_for [@ post, comment.new] ,: Remote = & gt; To be true F | & Gt%; & Lt; P & gt; & Lt;% = f.label: body, "new comment"% & gt; & Lt; Br / & gt; & Lt;% = f.text_area: Body% & gt; & Lt; / P & gt; & Lt; P & gt; & Lt;% = f.submit "Add comment", disable_with: "Adding comment ..."%> & Lt; / P & gt; & Lt;% end% & gt; This is the show point, as you can see that I tried to see that disabling the disable_with button would help but it is not.  

and below is comment_controller class commentsController < ApplicationController def can post @post = post.fund (param [: post_id]) @commmet = @ post quotations.cent! (Comment_param) Answer | Format.html {redirect_to @ post} format.js end-end personal def comment_adam params.require (: comment). Explicit (: commentator, body,: post_id) for end term

Thanks any advice

It seems that you have two sets of pre-installed properties locally:.

Try it on your machine:

  Railway_NV = Development Bundle Exposure Rock Property: Clubs RARS_Anv = Development Bundle App Rock Property: Precompile  
< P> happens to me at all times


No comments:

Post a Comment