# Render arguments :locals and :layout only available on partials?

**URL:** <https://www.ruby-forum.com/t/render-arguments-locals-and-layout-only-available-on-partials/134986>\
**Category:** Rails\
**Created:** [April 16, 2008, 9:27pm UTC](https://www.ruby-forum.com/t/render-arguments-locals-and-layout-only-available-on-partials/134986 "2008-04-16T21:27:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e68b1a/32.png) [@Pito](https://www.ruby-forum.com/u/Pito)\
**Post date:** [April 16, 2008, 9:27pm UTC](https://www.ruby-forum.com/t/render-arguments-locals-and-layout-only-available-on-partials/134986/1 "2008-04-16T21:27:00Z")

</div>

It looks to me like the :locals and :layout arguments for the render  
call don’t do anything unless you are rendering a :partial.

Is that right or am I misdiagnosing what’s happening to me?

---

<div class="post-metadata">

**Author:** ![Pito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/e68b1a/32.png) [@Pito](https://www.ruby-forum.com/u/Pito)\
**Post date:** [April 17, 2008, 5:14am UTC](https://www.ruby-forum.com/t/render-arguments-locals-and-layout-only-available-on-partials/134986/2 "2008-04-17T05:14:49Z")

</div>

I think you are right with :locals as that is specifically designed  
for passing variables into the partial to be used within the local  
scope of that partial. But :layout is for any render. You can specify  
a different layout or tell it to use none, i.e. :layout =\> false

[http://api.rubyonrails.com/classes/ActionController/Base.html#M000452](http://api.rubyonrails.com/classes/ActionController/Base.html#M000452)

-Danimal
