Forum: Ruby on Rails render_component ignores :layout => nil

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.
Henning (Guest)
on 2005-12-07 15:05
Hello,

I try to include an action to my main page like this:

<code><%= render_component(:controller => 'patient', :action => 'list',
:layout => nil) %></code>

But the action is rendered in the default layout. Why is <code>:layout
=> nil</code> ignored?
francois (Guest)
on 2005-12-07 15:44
(Received via mailing list)
try doing
:layout => false
Henning <> (Guest)
on 2005-12-07 15:52
> try doing
> :layout => false

It does not help.. any other ideas?
technoweenie (Guest)
on 2005-12-07 15:56
(Received via mailing list)
> >I try to include an action to my main page like this:
> >
> ><code><%= render_component(:controller => 'patient', :action => 'list',
> >:layout => nil) %></code>
> >
> >But the action is rendered in the default layout. Why is <code>:layout
> >=> nil</code> ignored?

The component is doing its own render call.  You will have to do
something like:

<%= render_component :controller => 'patient', :action => 'list',
:params => { :layout => false } %>

Then params[:layout] should be false.

--
rick
http://techno-weenie.net
This topic is locked and can not be replied to.