Rails 2 到 Rails 3 的转换
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 = Time.new
@content_type = "text/html"
end
end
请帮我将此 Rails 2.xx 代码转换为 Rails 3.xx
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 = Time.new
@content_type = "text/html"
end
end
Please help me to convert this Rails 2.xx code to Rails 3.x.x
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您阅读了以下三篇文章,全部取自 rails 演示,那么您应该有所收获:
我还推荐 此帖子
If you read te following three posts all taken from a rails demo then you should get somewhere:
I also recommend this post too