Say I have something like this in my js.erb file.
$(div_id + <%= @line_num %>).html("<%=j render :partial => "quant_change_form" %>");
That works fine but if I have a syntax error like say (i.e. method does not exist):
$(div_id + <%= @line_num %>).htmlabcd("<%=j render :partial => "quant_change_form" %>");
I don’t get a syntax error in my editor (I’m using RubyMine) and I don’t get an error in Firebug. It simply doesn’t work without telling me why. Isn’t this the recommended way you’re supposed to make an ajax call in rails?
Well, after doing a bit more searching, I found a reasonable solution. For some reason, if there’s an error in a js.erb file, it will fail silently and there will be no indication of an error in Firebug.
The solution to this problem is outlined here:
http://www.alfajango.com/blog/rails-js-erb-remote-response-not-executing/