diff options
author | José Valim <jose.valim@gmail.com> | 2009-10-17 10:31:11 -0300 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-11-01 02:23:47 +0100 |
commit | a9751a7034c5a2a49fd90e9f79ad5fcae103487b (patch) | |
tree | 59845a0bb38830586cbe475ec82ec50d6c545618 /actionpack/lib/abstract_controller/layouts.rb | |
parent | f4f76772fb5c25357a54baaa9cd20f7e9a1cd653 (diff) | |
download | rails-a9751a7034c5a2a49fd90e9f79ad5fcae103487b.tar.gz rails-a9751a7034c5a2a49fd90e9f79ad5fcae103487b.tar.bz2 rails-a9751a7034c5a2a49fd90e9f79ad5fcae103487b.zip |
Refactor ActionMailer layout and remove legacy one.
Diffstat (limited to 'actionpack/lib/abstract_controller/layouts.rb')
-rw-r--r-- | actionpack/lib/abstract_controller/layouts.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/actionpack/lib/abstract_controller/layouts.rb b/actionpack/lib/abstract_controller/layouts.rb index 796ef40584..4723e18a01 100644 --- a/actionpack/lib/abstract_controller/layouts.rb +++ b/actionpack/lib/abstract_controller/layouts.rb @@ -171,6 +171,26 @@ module AbstractController name && _find_layout(name, details) end + # Determine the layout for a given name and details, taking into account + # the name type. + # + # ==== Parameters + # name<String|TrueClass|FalseClass|Symbol>:: The name of the template + # details<Hash{Symbol => Object}>:: A list of details to restrict + # the lookup to. By default, layout lookup is limited to the + # formats specified for the current request. + def _layout_for_option(name, details) + case name + when String then _layout_for_name(name, details) + when true then _default_layout(details, true) + when :default then _default_layout(details, false) + when false, nil then nil + else + raise ArgumentError, + "String, true, or false, expected for `layout'; you passed #{name.inspect}" + end + end + # Take in the name and details and find a Template. # # ==== Parameters |