overallduka
overallduka

Reputation: 1549

Undefined method link_to_remote error Rails

I make a link_to_remote but this are the error:

NoMethodError in Tasks#index

Showing /Users/overallduka/youimports_app/app/views/tasks/index.html.erb where line #6 raised:

undefined method `link_to_remote' for #<#<Class:0x1022c76f0>:0x10216ff00>
Extracted source (around line #6):

3: <div id="all_tasks">
4: <% @tasks.each do |task| %>
5: &nbsp;<%= task.title %><br />
6: <p class="about_task"><%= link_to_remote task.status,"alert('aaa')" %> <%= task.about %></p>
7: <% end %>
8: </div>

I dont know what is wrong i make a sample alert to test but the error persistes, i dont know what is wrong in my view are:

NoMethodError in Tasks#index

Showing /Users/overallduka/youimports_app/app/views/tasks/index.html.erb where line #6 raised:

undefined method `link_to_remote' for #<#:0x10216ff00> Extracted source (around line #6):

<% @tasks.each do |task| %>
&nbsp;<%= task.title %><br />
<p class="about_task"><%= link_to_remote (status(task.status)),"alert('aaa')" %> <%= task.about %></p>
<% end %>

Upvotes: 0

Views: 768

Answers (1)

jvnill
jvnill

Reputation: 29599

link_to_remote and other remote ajax helpers have been removed in rails 3 and moved to a gem https://github.com/rails/prototype_legacy_helper. if you are only trying to run a simple js after clicking a link, use link_to_function instead

link_to_function 'test_alert', 'alert("test")'

Upvotes: 1

Related Questions