导致的routes.rb:导轨3:自定义路线在 '未定义局部变量或方法'
resources :conversations, only: [:index, :show, :new, :create, :destroy] do
collection do
get :inbox
end
在我的控制器:
def inbox
<stuff>
end
我认为(使用HAML):
=link_to 'Inbox', inbox_conversations, :id => 'load-inbox', :class => 'message-control-highlight', :remote => true
我得到的页面加载以下错误:
undefined local variable or method `inbox_conversations' for #<#<Class:0x3d51470>:0x3d59198>
在我看来,如果我用“#”取代inbox_conversations,我不会在页面加载时出现任何错误。我试着用可能的类来追加inbox_conversation,比如current_user和current_user.mailbox。我也试着改变从集合到成员的路由 - 甚至将它从任何集合/成员块中取出。这里可能是什么问题?
谢谢两位。那只是我需要的答案。 – nullnullnull 2012-07-20 19:04:05