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?
https://github.com/ging/mailboxer ?
/config/initializer/mailboxer.rb :
Mailboxer.setup do |config|
config.uses_emails = true
config.default_from = "[email protected]"
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With