This is the code I have in rails 3.1
<%= link_to 'All',:action => "bycategory", :id => 'All', :remote => true %>
I have defined a js.erb. This code works perfectly fine i.e invokes the JS when put in table with a certain CSS. When I just change the table id or put in a unordered list or anywhere else, it gives me template error as it looks for the html.erb. Just beats me :(.
one thing I found is that in the Params in the first case apart from the id and the remote , it also sends timestamp
In the second case time stamp is missing. Not sure why this is happening
Any help will be appreciated, have spent too much time debugging this
You might want to put the :action => “bycategory” and :id => ‘All’ in a hash as
This will generate the proper html attribute i.e. data-remote=”true” otherwise it will simply treat everything following as an http request attribute. Your code will generate –
whereas using the hash will generate something similar to