开发者

Rails 2 to Rails 3 conversion

class ForumMailer < ActionMailer::Base

  def new_post(user,post)  
    @subject        = "New post on #{post.topic.title} from #{SITE_NAME}"  
    @recipients     = user.profile.email  
    @body['user']   = user   
    @body['post']   = post  
    @from           = MAILER_FROM_ADDRESS  
    @sent_on       开发者_StackOverflow = Time.new  
    @content_type = "text/html"  

  end
end

Please help me to convert this Rails 2.xx code to Rails 3.x.x


If you read te following three posts all taken from a rails demo then you should get somewhere:

  • #43 A Contact Form - Rails Engines, The Enginex Gem and The MailForm Gem
  • #44 A Contact Form - Implementation
  • #45 A Contact Form - Rails Generators

I also recommend this post too

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜