aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/new_base.rb1
-rw-r--r--actionpack/lib/action_controller/new_base/content_type.rb15
-rw-r--r--actionpack/lib/action_view/template/text.rb3
3 files changed, 17 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/new_base.rb b/actionpack/lib/action_controller/new_base.rb
index bfd8120e10..9c8a6d0216 100644
--- a/actionpack/lib/action_controller/new_base.rb
+++ b/actionpack/lib/action_controller/new_base.rb
@@ -1,4 +1,5 @@
module ActionController
+ autoload :ContentType, "action_controller/new_base/content_type"
autoload :HideActions, "action_controller/new_base/hide_actions"
autoload :Http, "action_controller/new_base/base"
autoload :Layouts, "action_controller/new_base/layouts"
diff --git a/actionpack/lib/action_controller/new_base/content_type.rb b/actionpack/lib/action_controller/new_base/content_type.rb
new file mode 100644
index 0000000000..d2206a31af
--- /dev/null
+++ b/actionpack/lib/action_controller/new_base/content_type.rb
@@ -0,0 +1,15 @@
+module ActionController
+ module ContentType
+
+ def render_to_body(options = {})
+ if content_type = options[:content_type]
+ response.content_type = content_type
+ end
+
+ ret = super
+ response.content_type ||= options[:_template].mime_type
+ ret
+ end
+
+ end
+end \ No newline at end of file
diff --git a/actionpack/lib/action_view/template/text.rb b/actionpack/lib/action_view/template/text.rb
index f81174d707..446c735ba3 100644
--- a/actionpack/lib/action_view/template/text.rb
+++ b/actionpack/lib/action_view/template/text.rb
@@ -3,7 +3,6 @@ module ActionView #:nodoc:
def render(*) self end
- def exempt_from_layout?() false end
-
+ def mime_type() Mime::HTML end
end
end