1 controller, 2 layouts

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?

On 5/15/06, Brad D. [email protected] wrote:

use the application layout. Instead, the reports are wrapped in the


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

Hi Brad,

Please check out Is there a place for java in Ruby on Rails apps? - Rails - Ruby-Forum

Pat