aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
authorYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-06-16 13:44:51 -0700
committerYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-06-16 13:44:51 -0700
commitdd58f4021da30af7f40ee139e7487b887cac44e9 (patch)
tree34cb015228013c437851a3a13d7059357e57db13 /actionpack/lib/action_controller
parent01a4bc84b8787df74d54147a0cf564df75e87970 (diff)
downloadrails-dd58f4021da30af7f40ee139e7487b887cac44e9.tar.gz
rails-dd58f4021da30af7f40ee139e7487b887cac44e9.tar.bz2
rails-dd58f4021da30af7f40ee139e7487b887cac44e9.zip
An exception is raised if a layout is missing only if the layout is missing for all mimes
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r--actionpack/lib/action_controller/abstract/layouts.rb2
-rw-r--r--actionpack/lib/action_controller/base/layouts.rb4
-rw-r--r--actionpack/lib/action_controller/base/mime_responds.rb2
3 files changed, 5 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/abstract/layouts.rb b/actionpack/lib/action_controller/abstract/layouts.rb
index 2ac4e6068a..6aa196e807 100644
--- a/actionpack/lib/action_controller/abstract/layouts.rb
+++ b/actionpack/lib/action_controller/abstract/layouts.rb
@@ -140,6 +140,8 @@ module AbstractController
rescue NameError => e
raise NoMethodError,
"You specified #{@_layout.inspect} as the layout, but no such method was found"
+ rescue ActionView::MissingTemplate
+ _find_by_parts(_layout({}), {})
end
end
diff --git a/actionpack/lib/action_controller/base/layouts.rb b/actionpack/lib/action_controller/base/layouts.rb
index ace4b148c9..5c55e9745e 100644
--- a/actionpack/lib/action_controller/base/layouts.rb
+++ b/actionpack/lib/action_controller/base/layouts.rb
@@ -176,7 +176,7 @@ module ActionController
super
return if (options.key?(:text) || options.key?(:inline) || options.key?(:partial)) && !options.key?(:layout)
- layout = options.key?(:layout) ? options[:layout] : :none
+ layout = options.key?(:layout) ? options[:layout] : :default
options[:_layout] = _layout_for_option(layout, options[:_template].details)
end
@@ -184,7 +184,7 @@ module ActionController
case name
when String then _layout_for_name(name, details)
when true then _default_layout(details, true)
- when :none then _default_layout(details, false)
+ when :default then _default_layout(details, false)
when false, nil then nil
else
raise ArgumentError,
diff --git a/actionpack/lib/action_controller/base/mime_responds.rb b/actionpack/lib/action_controller/base/mime_responds.rb
index 5c7218691e..c0aa58a6c2 100644
--- a/actionpack/lib/action_controller/base/mime_responds.rb
+++ b/actionpack/lib/action_controller/base/mime_responds.rb
@@ -124,8 +124,8 @@ module ActionController #:nodoc:
@controller.formats = [mime_type.to_sym]
end
+ @controller.content_type = mime_type
@controller.template.formats = [mime_type.to_sym]
- @response.content_type = mime_type
block_given? ? block.call : @controller.send(:render, :action => @controller.action_name)
end