I am using ‘redmine’ (v 0.6) as my major project manager, seems running
fine w Rails 2.0 (slight modifs for paginations…) but I am stuck with a
major error when sending a confirmation email :
mailer.rb
class Mailer < ActionMailer::Base
…
Renders a message with the corresponding layout
def render_message(method_name, body)
layout = method_name.match(%r{text.html.(rhtml|rxml)}) ?
‘layout.text.html.rhtml’ : ‘layout.text.plain.rhtml’
body[:content_for_layout] = render(:file => method_name, :body =>
body)
ActionView::Base.new(File.join(template_root, ‘mailer’), body,
self).render(:file => layout)
end
end
the last line is not accepted when running rails 2.0 => ERROR
ActionView::ActionViewError (Due to changes in ActionMailer, you need to
provide the mailer_name along with the template name.
render “user_mailer/signup”
render :file => “user_mailer/signup”
If you are rendering a subtemplate, you must now use controller-like
partial syntax:
render :partial => ‘signup’ # no mailer_name necessary)
in debugging mode, I got :
File.join(template_root, ‘mailer’) => 'my_redmine_path/app/views/mailer
layout => “layout.text.html.rhtml”
body => { … :url … ::content_for_layout… , :token… } seems OK
I don’t know how to render correctly as rails 2.0 ActionMailer seems to
expect it …
any patch ?
thanks for your help