问题
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?
- Member registration (devise)
- 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