Neg*_*ron 8 ruby-on-rails ruby-on-rails-3
我想知道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 => true, {:action => :view_student_problem_set} %>
Run Code Online (Sandbox Code Playgroud)
显然是语法错误.
我尝试过的大多数组合都来自教程,论坛帖子和文档.我不认为符号集合必须按特定顺序排列,但我只是在彻底.无论如何,我的谷歌搜索技巧已经满足了他们的匹配.
form_tag和link_to标记之间的相关jquery代码,控制器代码和诸如此类的东西都是相同的.
谢谢你们.
fl0*_*00r 12
<%= link_to assignment.name, {:action => :view_student_problem_set}, :remote => true %>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11753 次 |
| 最近记录: |