1 controller, 2 layouts


#1

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?


#2

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