# Template location not default

**URL:** <https://www.ruby-forum.com/t/template-location-not-default/117770>\
**Category:** Rails\
**Created:** [October 20, 2007, 1:49am UTC](https://www.ruby-forum.com/t/template-location-not-default/117770 "2007-10-20T01:49:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![doug](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/dbc845/32.png) [@doug](https://www.ruby-forum.com/u/doug)\
**Post date:** [October 20, 2007, 1:49am UTC](https://www.ruby-forum.com/t/template-location-not-default/117770/1 "2007-10-20T01:49:16Z")

</div>

By default, Rails associates an action with a template having the  
same name as the name of the action and residing in a directory with  
the same name as the name of the controller.

Is there some way from within the action that I can change this  
behavior? I’m thinking that I could probably change it from within  
routes.rb; but, I’d really rather do it from within the action so that  
when I look at the action code I can clearly see what I did rather  
than spending time scratching my head and wondering why my action is  
displaying a non-default template.

Thanks for any input.

```
 ... doug
```

---

<div class="post-metadata">

**Author:** ![doug](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/dbc845/32.png) [@doug](https://www.ruby-forum.com/u/doug)\
**Post date:** [October 20, 2007, 1:51am UTC](https://www.ruby-forum.com/t/template-location-not-default/117770/2 "2007-10-20T01:51:02Z")

</div>

sure:

render :template =\> ‘path/to/template’

The path is rooted in /app/views.

-Bill

doug wrote:

> Thanks for any input.
> 
> ```
> ... doug
> 
> ```
> 
> >

–  
Sincerely,

William P.

---

<div class="post-metadata">

**Author:** ![doug](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/dbc845/32.png) [@doug](https://www.ruby-forum.com/u/doug)\
**Post date:** [October 20, 2007, 4:27am UTC](https://www.ruby-forum.com/t/template-location-not-default/117770/3 "2007-10-20T04:27:06Z")

</div>

Thanks, Bill, for the input. So, am I to conclude that  
render :template (unlike just plain ‘render’) terminates execution of  
the action or do I need to add ‘and return’ to make sure that the  
action terminates at that point? Thanks.

```
   ... doug
```

---

<div class="post-metadata">

**Author:** ![doug](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/dbc845/32.png) [@doug](https://www.ruby-forum.com/u/doug)\
**Post date:** [October 20, 2007, 5:09am UTC](https://www.ruby-forum.com/t/template-location-not-default/117770/4 "2007-10-20T05:09:50Z")

</div>

If you want to terminate at that point, you will have to add ‘and  
return’.

–Bill
