[Rails] layouts

Craig White
Thu, 23 Feb 2006 12:37:47 -0000

I created a controller called reports, for which I didn''t have any
model
or tables.

I wanted to use a menu/layout structure similar to all my other
models/controllers and added a layout named reports which then gives me
the menu/layout structure but is also now part of all my reports.

That isn''t gonna work so I renamed reports.rhtml to reports_forms.rhtml
(still inside my layouts directory) and then I created a model called
report.rb and inside it...

def forms
  render :action => "forms", :layout :=>
"reports_forms"
def

but that doesn''t work either.

How can I have a controller or view that selectively uses a layout?

Craig