【发布时间】:2017-08-08 18:57:18
【问题描述】:
我遵循https://www.sitepoint.com/rails-and-actioncable-adding-advanced-features 教程,但它说:
NameError in PersonalMessagesController#create uninitialized constant PersonalMessage::NotificationBroadcastJob
after_create_commit do
conversation.touch
NotificationBroadcastJob.perform_later(self)
end
end
提交时出现上述错误,但当我返回时收到一条消息。
所以我删除了代码:
after_create_commit do
conversation.touch
NotificationBroadcastJob.perform_later(self)
end
end
并尝试运行它。我没有看到同样的错误,但这次我不能实时聊天。
我忠实地遵循了教程。我不知道为什么会出现两个问题。我需要帮助。
我的github:https://github.com/sangyeol-kim/stackoverflow_ask_ac2
【问题讨论】:
标签: ruby-on-rails ruby chat actioncable