Forum: Ruby on Rails Re: render_component includes layout

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Cd4f9ba2512f984481b5b00279cee69a?d=identicon&s=25 oksteev (Guest)
on 2005-11-18 08:51
(Received via mailing list)
Matthew Denner <matt@...> writes:

> or by calling render(:layout=>false,...) in the action that creates the
> component."
>
> I've tried both of these and yet I still end up with the layout being
> included in the output.  The one thing that may be important is that the
> controller I'm rendering is nested, i.e. I have:
>

I have this same problem...

calling render_component :controller=>x, :action=>y with :layout =>
false or
:layout => nil still renders the layout for that controller.

Is there any way to make it not render the layout ?

- steve dp
8e44c65ac5b896da534ef2440121c953?d=identicon&s=25 ezra (Guest)
on 2005-11-18 19:23
(Received via mailing list)
On Nov 17, 2005, at 10:59 PM, steve dp wrote:

>> actions used to render components from layout processing, either
>> that the
>
> - steve dp

Guys-

	Here is how I get around this issue:

    def x
        if params[:no_layout]
	  do stuff....
	  render :layout => false
       else
          do stuff ....
          render :layout => "x_tmpl"
       end
    end

And then you can call the render_component like this:

  render_component( :controller=>x, :action=>y, :params =>
{:no_layout => true})


HTH-

-Ezra Zygmuntowicz
Yakima Herald-Republic
WebMaster
http://yakimaherald.com
509-577-7732
ezra@yakima-herald.com
This topic is locked and can not be replied to.