我是RJS的新手,我遵循this guide
中的简短示例我在application.html.erb
中包含了所有默认的javascript库当我启动服务器并检查页面时,出现错误:
Showing /Users/PowerBook/Desktop/makprojects/drummercymbal/app/views/videos/show.html.erb where line #9 raised:
undefined method `link_to_remote' for #<#<Class:0x217f64>:0x213d74>
Extracted source (around line #9):
6: <li>Cat</li>
7: <li>Mouse</li>
8: </ul>
9: <%= link_to_remote("Add a fox", :url => { :action => :add}) %>
答案 0 :(得分:25)
如果您使用的是rails 3.x.x,则没有link_to_remote
,那就是link_to 'Add a fox', { :action => :add}, :remote => true