diff options
Diffstat (limited to 'actionpack/lib/action_controller/new_base/layouts.rb')
-rw-r--r-- | actionpack/lib/action_controller/new_base/layouts.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/new_base/layouts.rb b/actionpack/lib/action_controller/new_base/layouts.rb index da516c0b85..3b47a76077 100644 --- a/actionpack/lib/action_controller/new_base/layouts.rb +++ b/actionpack/lib/action_controller/new_base/layouts.rb @@ -2,7 +2,7 @@ module ActionController module Layouts def render_to_string(options) if !options.key?(:text) || options.key?(:layout) - options[:_layout] = options.key?(:layout) ? _layout_for_option(options[:layout]) : _layout + options[:_layout] = options.key?(:layout) ? _layout_for_option(options[:layout]) : _default_layout end super @@ -13,7 +13,7 @@ module ActionController def _layout_for_option(name) case name when String then _layout_for_name(name) - when true then _layout + when true then _default_layout(true) when false then nil end end @@ -22,13 +22,14 @@ module ActionController view_paths.find_by_parts(name, formats, "layouts") end - def _layout + def _default_layout(require_layout = false) begin _layout_for_name(controller_path) rescue ActionView::MissingTemplate begin _layout_for_name("application") - rescue ActionView::MissingTemplate + rescue ActionView::MissingTemplate => e + raise e if require_layout end end end |