Anyone knows good private message gem for rails 3.2?

左心房为你撑大大i 提交于 2019-12-06 03:19:25

问题


I spent day and day to figure out how to make good messaging system between registered member via devise.

But in all cases, those gems are out of date and they don't support rails3.

If you guys are trying to make the system, which include these function. How do you make?

  1. Member registration (devise)
  2. private messaging system (with acition mailer)

回答1:


https://github.com/ging/mailboxer ?

/config/initializer/mailboxer.rb :

Mailboxer.setup do |config|
  config.uses_emails = true  
  config.default_from = "no-reply@youraddress.com"
end

minimal model

class User < ActiveRecord::Base
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable

  acts_as_messageable

  attr_accessible :email, :password, :password_confirmation, :remember_me

  def name
    email
  end

  def mailboxer_email(object)
    email
  end  
end

And of course starndard mailer configurations.




回答2:


Why are you trying to use ActionMailer? Are you sending emails or messages within the app? If you're just doing private messaging within the app, you should be able to create a PrivateMessage class:

class PrivateMessage
  has_one :sender, :class => 'User'
  has_one :recipient, :class => 'User'
end


来源:https://stackoverflow.com/questions/11113132/anyone-knows-good-private-message-gem-for-rails-3-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!