【问题标题】:ruby on rails // action cable chat tutorial errorruby on rails //动作电缆聊天教程错误
【发布时间】: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


    【解决方案1】:

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

    【讨论】:

    • 感谢您的建议。在您的帮助下,我不会收到通知错误!但我不能现场聊天。我不知道为什么。请帮帮我。
    • 是的。我没有发现任何错误页面。但是我不能实时聊天。 :( .....这是为什么..我不知道T_T ..
    猜你喜欢
    • 1970-01-01
    • 2017-02-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-28
    • 1970-01-01
    • 2016-07-15
    相关资源
    最近更新 更多