任何人都知道rails 3.2的私人消息宝石?

MKK*_*MKK 5 ruby-on-rails-plugins ruby-on-rails-3

我花了一天时间来弄清楚如何通过设计在注册会员之间建立良好的信息系统.

但在所有情况下,这些宝石都已过时,并且它们不支持rails3.

如果你们正在尝试制作包含这些功能的系统.你是怎么做的?

  1. 会员注册(设计)
  2. 私人消息系统(带有收件人邮件)

dim*_*uch 5

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
Run Code Online (Sandbox Code Playgroud)

最小的模型

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
Run Code Online (Sandbox Code Playgroud)

当然还有starndard邮件配置.


Wad*_*ndy 3

您为什么尝试使用 ActionMailer?您是否在应用程序内发送电子邮件或消息?如果您只是在应用程序中进行私人消息传递,您应该能够创建一个PrivateMessage类:

class PrivateMessage
  has_one :sender, :class => 'User'
  has_one :recipient, :class => 'User'
end
Run Code Online (Sandbox Code Playgroud)