我想知道link_to语法应该用于制作ajax请求(或其他想法,这里可能会出错).目前我有
<%= form_tag "save_sets", :remote => true, :name => "set_form" do %>
Run Code Online (Sandbox Code Playgroud)
在文件中,它完美地工作.但是,在同一个文件中,全部
<%= 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 %>
Run Code Online (Sandbox Code Playgroud)
只使用"?remote = true"而不是data-remote ="true"生成链接,并且
<%= link_to assignment.name, :remote …Run Code Online (Sandbox Code Playgroud)