Topic: can I use render(:partial => 'xxx') within an ActionMailer view ?

can I use render(:partial => 'xxx') within an ActionMailer view ?
does not seems like so, I'm getting an error from the Framework.

undefined method `controller_path' for ApplicationMailer:Class

/usr/local/lib/ruby/gems/1.8/gems/actionmailer-1.2.1/lib/action_mailer/base.rb:229:in `method_missing'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_view/partials.rb:93:in `partial_pieces'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_view/partials.rb:50:in `render_partial'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_view/base.rb:276:in `render'

#{RAILS_ROOT}/app/views/application_mailer/notify_order.rxml:1:in `_run_rxml_notify_order'

any solution to use partials without mailers ?

Re: can I use render(:partial => 'xxx') within an ActionMailer view ?

You have to call the partial as:

render :partial => './xxx'

because your mailer is not a controller and the Rails logic that puts paths together relies on controller name for that. Just tell Rails the partial is in the same directory and you should be fine.

Re: can I use render(:partial => 'xxx') within an ActionMailer view ?

thank you ! it makes sense.
I got it working.