mko
mko

Reputation: 22064

error: undefined method 'link_to_remote'

I'm new to RJS, I follow the short example in this guide

I'm including all the default javascript library in the application.html.erb

when I fire up the server and check the page, I got a error:

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

Upvotes: 10

Views: 5243

Answers (1)

tig
tig

Reputation: 27810

If you are using rails 3.x.x, than there is no link_to_remote, there is link_to 'Add a fox', { :action => :add}, :remote => true

Upvotes: 25

Related Questions