# Render custom mime types

**URL:** <https://www.ruby-forum.com/t/render-custom-mime-types/149637>\
**Category:** Rails\
**Created:** [September 27, 2008, 2:43am UTC](https://www.ruby-forum.com/t/render-custom-mime-types/149637 "2008-09-27T02:43:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nateleavitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3bc359/32.png) [@nateleavitt](https://www.ruby-forum.com/u/nateleavitt)\
**Post date:** [September 27, 2008, 2:43am UTC](https://www.ruby-forum.com/t/render-custom-mime-types/149637/1 "2008-09-27T02:43:56Z")

</div>

So I have this in my environment.rb file:

Mime::Type.register\_alias “text/html”, :help

Then in one of my views I have this:

\<%= render :partial =\> formatted\_summary\_account\_path(“help”) %\>

In my view folder I have \_summary.help.erb

When pulling up summary.erb I get this error:

ActionView::MissingTemplate in Accounts#summary

Showing accounts/summary.erb where line #102 raised:

Missing template account/\_summary.help in view path  
/Users/nate/Projects/rails/infused/apps/customerhub/app/views

Extracted source (around line #102):

99: \<%= image\_tag current\_style.company\_logo.url %\>  
100:   
101:

  
102: \<%= render :partial =\>  
formatted\_summary\_account\_path(“help”) %\>  
103: 
  
104:   
105: 

I dont’ understand because I do have \_summary.help there. Please Help.

---

<div class="post-metadata">

**Author:** ![nateleavitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3bc359/32.png) [@nateleavitt](https://www.ruby-forum.com/u/nateleavitt)\
**Post date:** [September 29, 2008, 6:15pm UTC](https://www.ruby-forum.com/t/render-custom-mime-types/149637/2 "2008-09-29T18:15:28Z")

</div>

Anyone?

---

<div class="post-metadata">

**Author:** ![nateleavitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3bc359/32.png) [@nateleavitt](https://www.ruby-forum.com/u/nateleavitt)\
**Post date:** [September 29, 2008, 6:27pm UTC](https://www.ruby-forum.com/t/render-custom-mime-types/149637/3 "2008-09-29T18:27:14Z")

</div>

Nate L. wrote:

> Missing template account/\_summary.help in view path

Seems like the path to your partial is wonky, as it’s looking for  
account/\_summary.help (singular) while your folder name is accounts  
(plural).

---

<div class="post-metadata">

**Author:** ![nateleavitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3bc359/32.png) [@nateleavitt](https://www.ruby-forum.com/u/nateleavitt)\
**Post date:** [September 29, 2008, 6:45pm UTC](https://www.ruby-forum.com/t/render-custom-mime-types/149637/4 "2008-09-29T18:45:56Z")

</div>

Ar Chron wrote:

> Nate L. wrote:
> 
> > Missing template account/\_summary.help in view path
> 
> Seems like the path to your partial is wonky, as it’s looking for  
> account/\_summary.help (singular) while your folder name is accounts  
> (plural).

Thanks for the reply… thanks for pointing that out. In my routes file  
i reference account singular… so in my app i just reference some like  
summary\_account\_path to go to the summary page in the accounts folder.  
Maybe the formatted doesn’t work the same?

Here is what I have in my routes file for account:

map.resource :account, :member =\> {  
:settings =\> :get,  
:reactivate =\> :put,  
:summary =\> :get  
}, :has\_many =\> :users

So i was assuming I could reference  
formatted\_summary\_account\_path(“help”) the same way. Any ideas why this  
isn’t working?

---

<div class="post-metadata">

**Author:** ![nateleavitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3bc359/32.png) [@nateleavitt](https://www.ruby-forum.com/u/nateleavitt)\
**Post date:** [September 29, 2008, 10:24pm UTC](https://www.ruby-forum.com/t/render-custom-mime-types/149637/5 "2008-09-29T22:24:03Z")

</div>

Nate L. wrote:

> Any ideas?

What does rake routes report?

I assume that you’ll need to dig around in the helper to see exactly  
what’s going on as to why accounts becomes account in the formatted  
version of the path…

For curiosity’s sake, what happens if you

map.resources :accounts {etc etc}

---

<div class="post-metadata">

**Author:** ![nateleavitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/3bc359/32.png) [@nateleavitt](https://www.ruby-forum.com/u/nateleavitt)\
**Post date:** [September 29, 2008, 9:08pm UTC](https://www.ruby-forum.com/t/render-custom-mime-types/149637/6 "2008-09-29T21:08:09Z")

</div>

Can anyone help me on why the formatted\_summary\_account\_path(‘help’)  
would reference the plural for of accounts?

In my app I can reference summary\_account\_path which references the  
‘accounts’ folder, but as soon as I add the formatted\_ on it changes and  
references the ‘account’ folder which doesn’t exist.

Any ideas?
