aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/new_base/layouts.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-06-01 09:38:09 +0100
committerPratik Naik <pratiknaik@gmail.com>2009-06-01 09:38:09 +0100
commit9d60525b5fc14b4b6f3ed9ba8ea874d6e76b4f78 (patch)
tree5a711cacac76a83ad12551023da8524f94e7365b /actionpack/lib/action_controller/new_base/layouts.rb
parentdc7323efd34327c13d26031b68e51314c24360f6 (diff)
parent9537fd0e3a7625afe4bee75d749647ca1837195a (diff)
downloadrails-9d60525b5fc14b4b6f3ed9ba8ea874d6e76b4f78.tar.gz
rails-9d60525b5fc14b4b6f3ed9ba8ea874d6e76b4f78.tar.bz2
rails-9d60525b5fc14b4b6f3ed9ba8ea874d6e76b4f78.zip
Merge commit 'mainstream/master'
Diffstat (limited to 'actionpack/lib/action_controller/new_base/layouts.rb')
-rw-r--r--actionpack/lib/action_controller/new_base/layouts.rb44
1 files changed, 21 insertions, 23 deletions
diff --git a/actionpack/lib/action_controller/new_base/layouts.rb b/actionpack/lib/action_controller/new_base/layouts.rb
index 35068db770..0ff71587d6 100644
--- a/actionpack/lib/action_controller/new_base/layouts.rb
+++ b/actionpack/lib/action_controller/new_base/layouts.rb
@@ -1,36 +1,34 @@
module ActionController
module Layouts
- extend ActiveSupport::DependencyModule
+ extend ActiveSupport::Concern
+
+ include ActionController::Renderer
+ include AbstractController::Layouts
- depends_on ActionController::Renderer
- depends_on AbstractController::Layouts
-
module ClassMethods
def _implied_layout_name
controller_path
end
end
-
- private
- def _determine_template(options)
- super
- if (!options.key?(:text) && !options.key?(:inline) && !options.key?(:partial)) || options.key?(:layout)
- options[:_layout] = _layout_for_option(options.key?(:layout) ? options[:layout] : :none, options[:_template].details)
+ private
+ def _determine_template(options)
+ super
+ if (!options.key?(:text) && !options.key?(:inline) && !options.key?(:partial)) || options.key?(:layout)
+ options[:_layout] = _layout_for_option(options.key?(:layout) ? options[:layout] : :none, options[:_template].details)
+ end
end
- end
-
- def _layout_for_option(name, details)
- case name
- when String then _layout_for_name(name, details)
- when true then _default_layout(true, details)
- when :none then _default_layout(false, details)
- when false, nil then nil
- else
- raise ArgumentError,
- "String, true, or false, expected for `layout'; you passed #{name.inspect}"
+
+ def _layout_for_option(name, details)
+ case name
+ when String then _layout_for_name(name, details)
+ when true then _default_layout(true, details)
+ when :none then _default_layout(false, details)
+ when false, nil then nil
+ else
+ raise ArgumentError,
+ "String, true, or false, expected for `layout'; you passed #{name.inspect}"
+ end
end
- end
-
end
end