Ruby on rails 3: link_to: remote => true treats "remote" as a URL parameter

I would like to know that the link_to syntax should be used to create ajax requests (or other ideas about what might be wrong here). I am currently

<%= form_tag "save_sets", :remote => true, :name => "set_form" do %> 

in the file and it works great. However, everything in the same file

 <%= 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 create links with "? remote = true" instead of data-remote = "true" and

 <%= link_to assignment.name, :remote => true, {:action => :view_student_problem_set} %> 

seems to be a syntax error.

Most of the combinations I've tried are tutorials, forum posts, and documentation. I did not think that collections of characters should be in a specific order, but I was just thorough. In any case, my search engine skills matched their relevance.

The corresponding jquery code, controller code, and much more are identical between the form_tag and link_to tags.

Thanks and all.

+8
ruby-on-rails ruby-on-rails-3
source share
1 answer
 <%= link_to assignment.name, {:action => :view_student_problem_set}, :remote => true %> 
+12
source share

All Articles