Rails 3: Link_to :remote => true with JQuery?
- by Derek
Question update:
I have figured out that importing JQuery (even without using it at all) is causing :remote => true to not work properly. I get the following error in the Chrome console:
Uncaught TypeError: Object [object Object] has no method 'dispatchEvent' (prototype.js:5653)
And when the link is clicked, it throws the same error again before redirecting.
Responder.erb.html
<ul>
<% @choices.each_with_index do |choice, index| %>
<li><%= link_to choice, { :action => "submit_response", :id => @id, :response => index }, :remote => true %></li>
<% end %>
</ul>
Example generated HTML:
<ul>
<li><a href="/poller/submit_response/yni?response=0" data-remote="true">True</a></li>
<li><a href="/poller/submit_response/yni?response=1" data-remote="true">False</a></li>
</ul>