# Template is missing error

**URL:** <https://www.ruby-forum.com/t/template-is-missing-error/87271>\
**Category:** Rails\
**Created:** [March 1, 2007, 11:52am UTC](https://www.ruby-forum.com/t/template-is-missing-error/87271 "2007-03-01T11:52:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andy\_pd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e480ec/32.png) [@Andy\_pd](https://www.ruby-forum.com/u/Andy_pd)\
**Post date:** [March 1, 2007, 11:52am UTC](https://www.ruby-forum.com/t/template-is-missing-error/87271/1 "2007-03-01T11:52:57Z")

</div>

Hello ,

I am using Rails 1.2.2 and Ruby 1.8.5.

According to what i have read rails redirects the request to a view  
with the same name as the controller.  
This is supposed to work even if you don’t explicitly give a  
render :template =\> call in your controller.

But some how this is not working.

I have store\_controller.rb in controllers and store.rthml in layouts .  
Yet Rails is complaining about a missing template.

am i missing something here ?

Thanks

---

<div class="post-metadata">

**Author:** ![Andy\_pd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e480ec/32.png) [@Andy\_pd](https://www.ruby-forum.com/u/Andy_pd)\
**Post date:** [March 1, 2007, 11:58am UTC](https://www.ruby-forum.com/t/template-is-missing-error/87271/2 "2007-03-01T11:58:59Z")

</div>

> According to what i have read rails redirects the request to a view  
> with the same name as the controller.  
> \<…\>

Well it is action, not controller. In case when action is not  
specified Rails will  
use ‘index’ as default.

> I have store\_controller.rb in controllers and store.rthml in layouts .  
> Yet Rails is complaining about a missing template.  
> am i missing something here ?

Yep, your are missing app/views/store/index.rhtml 😉

## Regards, Rimantas

[http://rimantas.com/](http://rimantas.com/)

---

<div class="post-metadata">

**Author:** ![Andy\_pd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e480ec/32.png) [@Andy\_pd](https://www.ruby-forum.com/u/Andy_pd)\
**Post date:** [March 1, 2007, 12:08pm UTC](https://www.ruby-forum.com/t/template-is-missing-error/87271/3 "2007-03-01T12:08:03Z")

</div>

Hello Rimantas,

Yes i am trying out the depot example from the rails book.  
But i do have a index action in the store\_controller.rb and also app/  
views/store/index.rhtml  
Also i am trying to use /app/views/layouts/store.rthml for creating  
the layout.

yet i am getting the error. any ideas?

Thanks

---

<div class="post-metadata">

**Author:** ![Andy\_pd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e480ec/32.png) [@Andy\_pd](https://www.ruby-forum.com/u/Andy_pd)\
**Post date:** [March 1, 2007, 12:50pm UTC](https://www.ruby-forum.com/t/template-is-missing-error/87271/4 "2007-03-01T12:50:11Z")

</div>

Hello Rimantas,

oops 🙂 am extremely sorry for this . i failed to notice something so  
obvious.  
yes its working fine now.

Thanks.

---

<div class="post-metadata">

**Author:** ![Andy\_pd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e480ec/32.png) [@Andy\_pd](https://www.ruby-forum.com/u/Andy_pd)\
**Post date:** [March 1, 2007, 12:24pm UTC](https://www.ruby-forum.com/t/template-is-missing-error/87271/5 "2007-03-01T12:24:05Z")

</div>

\<…\>

> Also i am trying to use /app/views/layouts/store.rthml for creating  
> the layout.
> 
> yet i am getting the error. any ideas?

Well, weird, unless your file indeed has “rthml” extension. It should  
be “rhtml” -  
“t” and “h” are swapped 🙂

## Regards, Rimantas

[http://rimantas.com/](http://rimantas.com/)
