小编Neg*_*ron的帖子

Ruby on rails 3:link_to:remote => true将"remote"视为URL参数

我想知道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)

ruby-on-rails ruby-on-rails-3

8
推荐指数
1
解决办法
1万
查看次数

标签 统计

ruby-on-rails ×1

ruby-on-rails-3 ×1