# Problems rendering templates for different mime-types

**URL:** <https://www.ruby-forum.com/t/problems-rendering-templates-for-different-mime-types/103503>\
**Category:** Rails\
**Created:** [May 7, 2007, 10:03am UTC](https://www.ruby-forum.com/t/problems-rendering-templates-for-different-mime-types/103503 "2007-05-07T10:03:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pixellover](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ee59a6/32.png) [@pixellover](https://www.ruby-forum.com/u/pixellover)\
**Post date:** [May 7, 2007, 10:03am UTC](https://www.ruby-forum.com/t/problems-rendering-templates-for-different-mime-types/103503/1 "2007-05-07T10:03:00Z")

</div>

Hi list,

I’ve got a little problem with rendering different mime-types. For  
example, I  
would like to append “.pdf” to my URL to generate a PDF. Appending  
“.pdf” to  
the url tells rails which part of the respond\_to block will be executes.  
So,  
if I append “.pdf”, it’ll run the format.pdf part and if nothing is  
appended,  
it’ll run the format.html part.

But obviously this doens’t tell rails wich template it should render.  
Whenever  
I register a new template handler for a mime-type (in my case: “.report”  
=\>  
ActionView::Base::register\_template\_handler :report,  
Acts::Reportable::View)  
rails tries to render that new template instead of the  
standard .rhtml-template.

For example, when I create a new report-template for an existing action  
in an  
existing controller (i.e. the action “show” for my  
controller “PeopleController”), rails try to render the .report-template  
instead of the .rhtml Template whenenver I call the  
address “[http://localhost:3000/people](http://localhost:3000/people)”.

What’s the idea behind this? Shouldn’t the .rhtml View be the default  
(as  
rails is mainly a web-framework)? How can I tell rails which template it  
should render by default?

Regards,  
Timo

---

<div class="post-metadata">

**Author:** ![pixellover](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ee59a6/32.png) [@pixellover](https://www.ruby-forum.com/u/pixellover)\
**Post date:** [May 8, 2007, 9:34am UTC](https://www.ruby-forum.com/t/problems-rendering-templates-for-different-mime-types/103503/2 "2007-05-08T09:34:55Z")

</div>

I really wonder if nobody else has this problem? I’ve got this problem  
with  
different plugins, registering all their own mime\_type\_handler. Before I  
open  
a bug report, I would like to know, if at least someone got this working  
and  
it’s just me or if there’s really a bug/misbehaviour.

Regards,  
Timo
