act_as_authenticated

前回の続き.どうやらuser_notifier.rbに問題があった模様.ちゃんとTestするべきだな....

class UserNotifier < ActionMailer::Base
  def signup_notification(user)
    setup_email(user)
    @subject    += 'Please activate your new account'
    @body[:url]  = "http://domain/account/activate/#{user.activation_code}"
  end

  def activation(user)
    setup_email(user)
    @subject    += 'Your account has been activated!'
    @body[:url]  = "http://domain/"
  end

  protected
  def setup_email(user)
    @recipients  = "#{user.email}"
    @from        = "info@domain"
    @subject     = "Activation!"
    @sent_on     = Time.now
    @body[:user] = user
  end
end
 
comments powered by Disqus