Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #307 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

[PATCH] Default layout is set automatically if it exists

Reported by: marcel Assigned to: David
Priority: normal Milestone: 0.9
Component: ActionPack Version: 0.8
Severity: normal Keywords:
Cc:

Description

The following patch makes it so that Action Pack, unless otherwise instructed, will set the current layout to the controller name if it exists and otherwise 'application' if that exists.

So if you are making a request for UserController, if app/views/layouts/user.rhtml or app/views/layouts/user.rxml exists then 'user' will automatically be set as the layout for the controller without having to include a 'layout "user"' line in the controller. Likewise, if no layout exists with the name 'user' but one exists with the name 'application' it will set that as the controller's layout. If an explicit call to 'layout' exists in the controller then the one specified there will override this behaviour.

Attachments

AP-default_layouts_set_automatically.diff (1.5 kB) - added by marcel on 12/14/04 21:03:57.
Tries to automatically set a controller's layout

Change History

12/14/04 21:03:57 changed by marcel

  • attachment AP-default_layouts_set_automatically.diff added.

Tries to automatically set a controller's layout

12/15/04 11:39:34 changed by david

  • status changed from new to closed.
  • resolution set to fixed.