Changeset 3551
- Timestamp:
- 02/08/06 05:24:53 (3 years ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller/filters.rb (modified) (1 diff)
- trunk/actionpack/lib/action_controller/layout.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r3550 r3551 1 1 *SVN* 2 3 * Replace dubious controller parent class in filter docs. #3655, #3722 [info@rhalff.com, eigentone@gmail.com] 2 4 3 5 * Don't interpret the :value option on text_area as an html attribute. Set the text_area's value. #3752 [gabriel@gironda.org] trunk/actionpack/lib/action_controller/filters.rb
r3504 r3551 142 142 # end 143 143 # 144 # class SignupController < A ctionController::Base144 # class SignupController < ApplicationController 145 145 # # will not run the :authenticate filter 146 146 # skip_before_filter :authenticate trunk/actionpack/lib/action_controller/layout.rb
r3493 r3551 67 67 # the layout for your WeblogController. You can create a layout with the name <tt>application.rhtml</tt> or <tt>application.rxml</tt> 68 68 # and this will be set as the default controller if there is no layout with the same name as the current controller and there is 69 # no layout explicitly assigned with the +layout+ method. Setting a layout explicitly will always override the automatic behaviour 70 # for the controller where the layout is set. Explicitly setting the layout in a parent class, though, will not override the 71 # child class's layout assignement if the child class has a layout with the same name. 69 # no layout explicitly assigned with the +layout+ method. Nested controllers use the same folder structure for automatic layout. 70 # assignment. So an Admin::WeblogController will look for a template named <tt>app/views/layouts/admin/weblog.rhtml</tt>. 71 # Setting a layout explicitly will always override the automatic behaviour for the controller where the layout is set. 72 # Explicitly setting the layout in a parent class, though, will not override the child class's layout assignement if the child 73 # class has a layout with the same name. 72 74 # 73 75 # == Inheritance for layouts … … 176 178 inherited_without_layout(child) 177 179 child.send :include, Reloadable 178 layout_match = child.name.underscore.sub(/_controller$/, '') 180 layout_match = child.name.underscore.sub(/_controller$/, '').sub(/^controllers\//, '') 179 181 child.layout(layout_match) unless layout_list.grep(%r{layouts/#{layout_match}\.[a-z][0-9a-z]*$}).empty? 180 182 end