我有以下文件:
/app/views/admin/newsletters/1_announcement_html.html.erb
在admin控制器中,我想将此文件的内容设置为变量,以允许我将var发送到用户邮件程序。我怎样才能做到这一点?我有:
def newsletter_deliver
from = params[:from]
to = params[:to]
bcc = params[:bcc]
subject = params[:subject]
text = render :file => "admin/newsletters/1_announcement_text.html.erb"
html = render :file => "admin/newsletters/1_announcement_html.html.erb"
UserMailer.newsletter(from,to,bcc,subject,html,text).deliver
render :text => 'Sent'
end
DoubleRenderError出现此错误。想法?感谢