Ruby on rails Rails 3:路径在视图中不响应,但在控制台中工作

Ruby on rails Rails 3:路径在视图中不响应,但在控制台中工作,ruby-on-rails,ruby-on-rails-3,Ruby On Rails,Ruby On Rails 3,我可以在控制台上运行此命令: @user.relationships.find_by_followed_id(9) 但我不能在我的观点中使用这个: <%= form_for current_user.relationships.find_by_followed_id(9), :html => { :method => :delete } do |f| %> {:method=>:delete}do | f |%> 错误是: undefined method `rel

我可以在控制台上运行此命令:

@user.relationships.find_by_followed_id(9)
但我不能在我的观点中使用这个:

<%= form_for current_user.relationships.find_by_followed_id(9), :html => { :method => :delete } do |f| %>
{:method=>:delete}do | f |%>
错误是:

undefined method `relationship_path' for #<#<Class:0x00000100bdc008>:0x00000100bc1f50>
未定义的方法“关系路径”#

我不明白为什么。

您没有定义关系资源/模型的路径…

是的,我在您编写之前就已经弄明白了。太蠢了。。我花了60分钟才弄明白。我以为路线在那里。谢谢