I have a problem with Rails and Jquery. Im using AJAX to add comments to articles without reloading them. The following code got automatically included in my views/application.html:
<%= javascript_include_tag "application" %>
<%= javascript_include_tag :all %>
<%= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" %>
<%= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js" %>
Everything seemed to work fine, until i realised that the server console shows the following error:
ActionController::RoutingError (No route matches [GET] "assets/all.js")
So since this line doesn't seem to add anything to the application other than an error i deleted it. Next time I started the server and used the application all of a sudden every comment gets posted twice!? Otherwise everything still worked fine. So I added the deleted line again and I have no idea why but when I add the line
<%= javascript_include_tag :all %>
again everythings works fine again, only one comment gets posted as intended. However I dont want to keep this in the code since it throws an error. Can someone explain this behaviour and tell me how to fix this?