# Question about using layout template in controller

**URL:** <https://www.ruby-forum.com/t/question-about-using-layout-template-in-controller/169963>\
**Category:** Rails\
**Created:** [June 10, 2009, 7:01pm UTC](https://www.ruby-forum.com/t/question-about-using-layout-template-in-controller/169963 "2009-06-10T19:01:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![grasshopper](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f19dbf/32.png) [@grasshopper](https://www.ruby-forum.com/u/grasshopper)\
**Post date:** [June 10, 2009, 7:01pm UTC](https://www.ruby-forum.com/t/question-about-using-layout-template-in-controller/169963/1 "2009-06-10T19:01:36Z")

</div>

Hello all,

I’d like to use " layout ‘template\_name’ " in a controller. However,  
I’d also like to have an action on this controller not be rendered  
within this layout template rather just render the action’s  
corresponding view.

Can this be done?

Thanks

---

<div class="post-metadata">

**Author:** ![grasshopper](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f19dbf/32.png) [@grasshopper](https://www.ruby-forum.com/u/grasshopper)\
**Post date:** [June 10, 2009, 7:32pm UTC](https://www.ruby-forum.com/t/question-about-using-layout-template-in-controller/169963/2 "2009-06-10T19:32:41Z")

</div>

So try: layout ‘template\_name’, :except =\> :my\_action

where :my\_action is the action you don’t want rendered in the context  
of the specified layout.
