diff options
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/abstract/layouts.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_view/template/template.rb | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/abstract/layouts.rb b/actionpack/lib/action_controller/abstract/layouts.rb index b3b743d6e8..8721e5f4dc 100644 --- a/actionpack/lib/action_controller/abstract/layouts.rb +++ b/actionpack/lib/action_controller/abstract/layouts.rb @@ -85,7 +85,7 @@ module AbstractController end begin - _layout_for_name(_layout) if _action_has_layout? + _layout_for_name(_layout, details) if _action_has_layout? rescue NameError => e raise NoMethodError, "You specified #{@_layout.inspect} as the layout, but no such method was found" diff --git a/actionpack/lib/action_view/template/template.rb b/actionpack/lib/action_view/template/template.rb index d58f4ec19e..f61dd591a5 100644 --- a/actionpack/lib/action_view/template/template.rb +++ b/actionpack/lib/action_view/template/template.rb @@ -15,11 +15,12 @@ module ActionView @handler = handler @details = details - format = details[:format] || begin + format = details.delete(:format) || begin # TODO: Clean this up handler.respond_to?(:default_format) ? handler.default_format.to_sym.to_s : "html" end @mime_type = Mime::Type.lookup_by_extension(format.to_s) + @details[:formats] = Array.wrap(format && format.to_sym) end def render(view, locals, &blk) |