Changeset 6516
- Timestamp:
- 04/12/07 17:11:48 (2 years ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller/layout.rb (modified) (1 diff)
- trunk/actionpack/test/controller/layout_test.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r6508 r6516 1 1 *SVN* 2 3 * Allow layouts with extension of .html.erb. Closes #8032 [Josh Knowles] 2 4 3 5 * Change default respond_to templates for xml and rjs formats. [Rick] trunk/actionpack/lib/action_controller/layout.rb
r6396 r6516 191 191 inherited_without_layout(child) 192 192 layout_match = child.name.underscore.sub(/_controller$/, '').sub(/^controllers\//, '') 193 child.layout(layout_match) unless child.layout_list.grep(%r{layouts/#{layout_match} \.[a-z][0-9a-z]*$}).empty?193 child.layout(layout_match) unless child.layout_list.grep(%r{layouts/#{layout_match}(\.[a-z][0-9a-z]*)+$}).empty? 194 194 end 195 195 trunk/actionpack/test/controller/layout_test.rb
r6178 r6516 29 29 end 30 30 31 class MultipleExtensions < LayoutTest 32 end 33 31 34 class MabView 32 35 def initialize(view) … … 72 75 assert_equal 'layouts/controller_name_space/nested', @controller.active_layout 73 76 assert_equal 'controller_name_space/nested.rhtml hello.rhtml', @response.body 77 end 78 79 def test_namespaced_controllers_auto_detect_layouts 80 @controller = MultipleExtensions.new 81 get :hello 82 assert_equal 'layouts/multiple_extensions', @controller.active_layout 83 assert_equal 'multiple_extensions.html.erb hello.rhtml', @response.body.strip 74 84 end 75 85 end