use*_*569 1 ruby debugging ruby-on-rails ruby-on-rails-3
我的视频控制器中有这种方法:
def notifications
erase_notification_count
end
Run Code Online (Sandbox Code Playgroud)
它调用erase_notification_count我的用户模型中定义的方法:
def erase_notification_count
new_notification_count += (self.notifications.count * (-1))
end
Run Code Online (Sandbox Code Playgroud)
这是我得到的错误:
NameError in VideosController#notifications
undefined local variable or method `erase_notification_count' for #<VideosController:0x102f0fed0>
Run Code Online (Sandbox Code Playgroud)
为什么我收到此错误?我如何解决它?
| 归档时间: |
|
| 查看次数: |
1233 次 |
| 最近记录: |