I'd like to know what the link_to syntax is supposed to be for making ajax requests (or other ideas on what might be going wrong here). Currently I have
<%= form_tag "save_sets", :remote => true, :name => "set_form" do %>
in a file and it works perfectly. However, in the very same file, all of
<%= link_to assignment.name, :action => :view_student_problem_set, :remote => true %>
<%= link_to assignment.name, :remote => true, :action => :view_student_problem_set %>
<%= link_to assignment.name, {:action => :view_student_problem_set, :remote => true} %>
<%= link_to assignment.name, {:remote => true, :action => :view_student_problem_set} %>
<%= link_to assignment.name, {:remote => true}, {:action => :view_student_problem_set}
<%= link_to assignment.name, {:remote => true}, :action => :view_student_problem_set %>
just produce links with "?remote=true" instead of data-remote="true", and
<%= link_to assignment.name, :remote => true, {:action => :view_student_problem_set} %>
is apparently a syntax error.
Most of the combinations I have tried are from tutorials, forum posts, and documentation. I didn't think that collections of symbols had to be in a particular order, but I was just being thorough. In any event, my googling skills have met their match.
The relevant jquery code, controller code, and whatnot is all identical between the form_tag and the link_to tags.
Thanks and all.
<%= link_to assignment.name, {:action => :view_student_problem_set}, :remote => true %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With