Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Anyone knows good private message gem for rails 3.2?

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)
like image 693
MKK Avatar asked Jun 20 '12 05:06

MKK


2 Answers

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.

like image 170
dimuch Avatar answered Nov 09 '22 18:11

dimuch


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
like image 3
Wade Tandy Avatar answered Nov 09 '22 16:11

Wade Tandy