ruby on rails //动作电缆聊天教程错误

时间:2017-08-08 18:57:19

标签: ruby-on-rails ruby chat actioncable

我按照https://www.sitepoint.com/rails-and-actioncable-adding-advanced-features教程,但它说:

  

PersonalMessagesController中的NameError #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

1 个答案:

答案 0 :(得分:0)

尝试修复文件名notifications_broadcast_job.rb - > notification_broadcast_job.rb