# Need to use a method without the layout

**URL:** <https://www.ruby-forum.com/t/need-to-use-a-method-without-the-layout/56419>\
**Category:** Rails\
**Created:** [March 31, 2006, 2:39am UTC](https://www.ruby-forum.com/t/need-to-use-a-method-without-the-layout/56419 "2006-03-31T02:39:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cranberry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5e9695/32.png) [@cranberry](https://www.ruby-forum.com/u/cranberry)\
**Post date:** [March 31, 2006, 2:39am UTC](https://www.ruby-forum.com/t/need-to-use-a-method-without-the-layout/56419/1 "2006-03-31T02:39:23Z")

</div>

I need to use a method (called by one of my controllers) without using  
the layout. All the other methods in the controller need to use this  
layout except for thismethod (becausae it’s called by an Ajax script). I  
know how to use :layout=\>layout\_name when calling a method from another  
method, but nothing is calling this.  
The layout needs to be removed in the method itself or I need to call  
another (‘blank’) method instead.

Please help!

thank you!

---

<div class="post-metadata">

**Author:** ![cranberry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5e9695/32.png) [@cranberry](https://www.ruby-forum.com/u/cranberry)\
**Post date:** [March 31, 2006, 3:13am UTC](https://www.ruby-forum.com/t/need-to-use-a-method-without-the-layout/56419/2 "2006-03-31T03:13:18Z")

</div>

> From [Peak Obsession](http://api.rubyonrails.com/classes/ActionController/Base.html#M000205)

# Renders the template for the action “short\_goal” within the

current controller,

# but without the current active layout

render :action =\> “short\_goal”, :layout =\> false

hope that helps.  
Anthony Moralez  
[http://anthonysseblog.blogspot.com](http://anthonysseblog.blogspot.com)

---

<div class="post-metadata">

**Author:** ![cranberry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5e9695/32.png) [@cranberry](https://www.ruby-forum.com/u/cranberry)\
**Post date:** [March 31, 2006, 4:18am UTC](https://www.ruby-forum.com/t/need-to-use-a-method-without-the-layout/56419/3 "2006-03-31T04:18:12Z")

</div>

Anthony Moralez wrote:

> > From [Peak Obsession](http://api.rubyonrails.com/classes/ActionController/Base.html#M000205)
> 
> # Renders the template for the action “short\_goal” within the
> 
> current controller,
> 
> # but without the current active layout
> 
> render :action =\> “short\_goal”, :layout =\> false
> 
> hope that helps.  
> Anthony Moralez  
> [http://anthonysseblog.blogspot.com](http://anthonysseblog.blogspot.com)

Thank, but this will _not_ work because nothing is rendering this  
method. Any other suggestions?

---

<div class="post-metadata">

**Author:** ![cranberry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5e9695/32.png) [@cranberry](https://www.ruby-forum.com/u/cranberry)\
**Post date:** [March 31, 2006, 12:35pm UTC](https://www.ruby-forum.com/t/need-to-use-a-method-without-the-layout/56419/4 "2006-03-31T12:35:15Z")

</div>

layout “standard”,:except=\>“some\_action”

On Friday, March 31, 2006, at 4:18 AM, cranberry wrote:

> > Anthony Moralez  
> > [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)  
> > Mikkel B.

www.strongside.dk - Football Portal(DK)  
ting.minline.dk - Buy Old Stuff!(DK)
