我做了一个 link_to_remote 但这是错误:
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: <%= task.title %><br />
6: <p class="about_task"><%= link_to_remote task.status,"alert('aaa')" %> <%= task.about %></p>
7: <% end %>
8: </div>
我不知道出了什么问题,我制作了一个样本警报进行测试,但错误仍然存在,我不知道我认为有什么问题是:
任务中的 NoMethodError#index
显示 /Users/overallduka/youimports_app/app/views/tasks/index.html.erb 其中第 6 行提出:
#<#:0x10216ff00> 的未定义方法 `link_to_remote' 提取的源代码(第 6 行附近):
<% @tasks.each do |task| %>
<%= task.title %><br />
<p class="about_task"><%= link_to_remote (status(task.status)),"alert('aaa')" %> <%= task.about %></p>
<% end %>