diff options
author | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-05-11 15:03:24 -0700 |
---|---|---|
committer | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-05-11 15:03:24 -0700 |
commit | 0cac68d3bed3e6bf8ec2eb994858e4a179046941 (patch) | |
tree | 6f6d89a9bf66064e4acb8392d54648b4bf37f9f0 /actionpack/lib/action_controller/new_base/layouts.rb | |
parent | ddbeb15a5e7e0c3c5f316ccf65b557bc5311a6c4 (diff) | |
download | rails-0cac68d3bed3e6bf8ec2eb994858e4a179046941.tar.gz rails-0cac68d3bed3e6bf8ec2eb994858e4a179046941.tar.bz2 rails-0cac68d3bed3e6bf8ec2eb994858e4a179046941.zip |
Revert "Whitespace!"
This reverts commit a747ab5b20b9d543e9d311070e3b720c761ae716.
Diffstat (limited to 'actionpack/lib/action_controller/new_base/layouts.rb')
-rw-r--r-- | actionpack/lib/action_controller/new_base/layouts.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/actionpack/lib/action_controller/new_base/layouts.rb b/actionpack/lib/action_controller/new_base/layouts.rb index 228162421d..89d24fe92d 100644 --- a/actionpack/lib/action_controller/new_base/layouts.rb +++ b/actionpack/lib/action_controller/new_base/layouts.rb @@ -4,13 +4,13 @@ module ActionController depends_on ActionController::Renderer depends_on AbstractController::Layouts - + module ClassMethods def _implied_layout_name controller_path end end - + def render_to_body(options) # render :text => ..., :layout => ... # or @@ -18,20 +18,22 @@ module ActionController if !options.key?(:text) || options.key?(:layout) options[:_layout] = options.key?(:layout) ? _layout_for_option(options[:layout]) : _default_layout end - + super end - + private + def _layout_for_option(name) case name when String then _layout_for_name(name) when true then _default_layout(true) when false, nil then nil else - raise ArgumentError, - "String, true, or false, expected for `layout'; you passed #{name.inspect}" + raise ArgumentError, + "String, true, or false, expected for `layout'; you passed #{name.inspect}" end end + end end |