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.
oksteev (Guest)
on 2005-11-18 09:51
(Received via mailing list)
Matthew D. <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
ezra (Guest)
on 2005-11-18 20: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 Z.
Yakima Herald-Republic
WebMaster
http://yakimaherald.com
509-577-7732
removed_email_address@domain.invalid
This topic is locked and can not be replied to.