Forum: Ruby on Rails 1 controller, 2 layouts

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.
Brad D. (Guest)
on 2006-05-16 02:42
I am having an issue with a controller that needs to utilize two
different layouts, depending on the action. The entire app makes use of
the application layout, so I added this to my controller to use for all
of our reports:

class ReportsController < ApplicationController
  layout "reporter", :except => :index

I was hoping that the layout would only be applied to all the actual
reports (there are several), while the index action would continue to
use the application layout. Instead, the reports are wrapped in the
layout, while index is not wrapped with anything. I went on to try this:

class ReportsController < ApplicationController
  layout "application", :only => :index
  layout "reporter", :except => :index

But, no dice. It always just responds to the last statement. Any ideas?
Pat M. (Guest)
on 2006-05-16 02:48
(Received via mailing list)
On 5/15/06, Brad D. <removed_email_address@domain.invalid> wrote:
> use the application layout. Instead, the reports are wrapped in the
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>

Hi Brad,

Please check out http://www.ruby-forum.com/topic/65701#77328

Pat
This topic is locked and can not be replied to.