I user private_pub gem on my rails app I am using pjax also
i have a form submitted with ajax
and on my create.js.erb file I have these code
<% publish_to "/posts/#{@message.post.id}" do %>
$('ul#comments<%=comment.id%>').append('<%= escape_javascript (@comment)%>')
<% end %>
comments are appended many time
when I remove the publish_to method or reloading the page it working good
these issue made me crazy
these code is on a div loaded by jquery.load() every time I load the div ,,jquery.append() increased by once ..when I remove publish_to ..jquery.append() working good ...
I user private_pub gem on my rails app I am using pjax also i have a form submitted with ajax and on my create.js.erb file I have these code
<% publish_to "/posts/#{@message.post.id}" do %> $('ul#comments<%=comment.id%>').append('<%= escape_javascript (@comment)%>') <% end %> comments are appended many time when I remove the publish_to method or reloading the page it working good these issue made me crazy