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

Ticket #2610 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Setting a layout has no effect if a layout file of the same name is present.

Reported by: Charles M. Gerungan Assigned to: David
Priority: normal Milestone:
Component: ActionPack Version: 0.14.2
Severity: normal Keywords:
Cc: charles.gerungan@gmail.com

Description

The API doc at http://rails.rubyonrails.com/classes/ActionController/Layout/ClassMethods.html says on Automatic layout assignment: "Setting a layout explicitly will always override the automatic behaviour." I don't know if this only pertains to only application.rhtml, but the file with the same name as the controller is still being used instead of the file specified:

class Admin::BaseController < ApplicationController

layout 'admin'

end

class Admin::MyController < Admin::BaseController

# If my.rhtml exists it will still be used

end

Change History

10/26/05 11:24:33 changed by anonymous

  • summary changed from Setting a layout has no effect is a layout file of the same name is present. to Setting a layout has no effect if a layout file of the same name is present..

11/20/05 18:50:11 changed by marcel

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

(In [3111]) Correct docs for automatic layout assignment. Closes #2610.

11/20/05 18:55:28 changed by marcel

(In [3112]) Apply #3111 to stable. Correct docs for automatic layout assignment. Closes #2610.