错误:未定义的方法'link_to_remote'

时间:2010-12-16 05:03:22

标签: ruby-on-rails

我是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}) %>

1 个答案:

答案 0 :(得分:25)

如果您使用的是rails 3.x.x,则没有link_to_remote,那就是link_to 'Add a fox', { :action => :add}, :remote => true