Rails 中的消息系统
我想在 Rails 中设置一个白名单消息系统,用户可以选择他们想要发送评论的其他用户。该消息可能对所有人或只有一个人可见。我该如何设置以及消息表单会是什么样子?
I want to set up a whitelist messaging system in rails where users can select which other users they want to send the comment. The message could be visible to everyone or just one person. How would I set this up and what would the message form look like?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
添加仅包含
message_id
和recipient_id
的联接表。选项是为每个收件人复制消息。这是一个很好的解决方案,每个收件人都可以完全控制他们的邮件收件箱(例如删除邮件)。
Either add a join table with only a
message_id
andrecipient_id
.Option is duplicating the message for each recipient. This is a great solution is each recipient has full control over their message inbox (e.g. delete the message).
您还可以查看 acts_as_messageable 插件。它有点过时了,但它解决了您的担忧。
You might also take a look at the acts_as_messageable plugin. It's a bit out of date, but it addresses your concerns.