# ActionMailer (No rhtml, rxml, rjs or delegate template found

**URL:** <https://www.ruby-forum.com/t/actionmailer-no-rhtml-rxml-rjs-or-delegate-template-found/86996>\
**Category:** Engines Development\
**Created:** [February 27, 2007, 1:16pm UTC](https://www.ruby-forum.com/t/actionmailer-no-rhtml-rxml-rjs-or-delegate-template-found/86996 "2007-02-27T13:16:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ian\_Duggan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/848f3c/32.png) [@Ian\_Duggan](https://www.ruby-forum.com/u/Ian_Duggan)\
**Post date:** [February 27, 2007, 1:16pm UTC](https://www.ruby-forum.com/t/actionmailer-no-rhtml-rxml-rjs-or-delegate-template-found/86996/1 "2007-02-27T13:16:39Z")

</div>

Just spent a chunk of time hunting this down. I don’t see any open  
issues against this (I only see one open issue?).

Anyhow, it seems that engines munge the base\_path of ActionView::Base in  
such a way that the ActionMailer cannot find it’s templates. It’s doing  
a FileTest.exist?(path) on a path of ‘{a,b,c}/template.rhml’ and is  
failing. I had to toss the following in the mix to get things working:

# Fix for engines and ActionMailer

module ActionView  
class Base  
private  
def template\_exists?(template\_path, extension)  
file\_path = full\_template\_path(template\_path, extension)  
@@method\_names.has\_key?(file\_path) ||  
!Dir.glob(file\_path).empty?  
end

```
  def read_template_file(template_path, extension)
    File.read(Dir.glob(template_path).first)
  end

```

end  
end

Not sure if I’m doing something else wrong to cause these to be needed.  
Looking through the engines code, this stuff doesn’t seem to be covered.  
Incidentally, I tried adding these to the  
rails\_extensions/templates.rb file, but they don’t seem to get pulled in  
properly.

–Ian

---

<div class="post-metadata">

**Author:** ![Ian\_Duggan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/848f3c/32.png) [@Ian\_Duggan](https://www.ruby-forum.com/u/Ian_Duggan)\
**Post date:** [February 27, 2007, 1:56pm UTC](https://www.ruby-forum.com/t/actionmailer-no-rhtml-rxml-rjs-or-delegate-template-found/86996/2 "2007-02-27T13:56:45Z")

</div>

Hi Ian,

Thanks for the report. This stuff should certainly be covered, if it’s  
broken.

Can you create a ticket detailing which version of Rails you’re  
running against and as much detail about replicating the bug as  
possible? You can find login information here:  
[http://rails-engines.org/faq/issue-tracker-login-information/](http://rails-engines.org/faq/issue-tracker-login-information/)

Cheers,

James
