Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move ContentType inline for now.

Trying to avoid premature proliferation of modules.
  • Loading branch information...
commit d58b57a3caf4ad434c2be4f63eecd9a1921c7c4a 1 parent b98e496
Yehuda Katz + Carl Lerche authored
View
1  actionpack/lib/action_controller/new_base.rb
@@ -1,5 +1,4 @@
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"
View
15 actionpack/lib/action_controller/new_base/content_type.rb
@@ -1,15 +0,0 @@
-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
View
10 actionpack/lib/action_controller/new_base/renderer.rb
@@ -24,7 +24,9 @@ def render_to_body(options)
options[:_prefix] = _prefix
end
- super(options)
+ ret = super(options)
+ response.content_type ||= options[:_template].mime_type
+ ret
end
private
@@ -43,9 +45,9 @@ def _text(options)
end
def _process_options(options)
- if status = options[:status]
- response.status = status.to_i
- end
+ status, content_type = options.values_at(:status, :content_type)
+ response.status = status.to_i if status
+ response.content_type = content_type if content_type
end
end
end
View
1  actionpack/test/new_base/test_helper.rb
@@ -42,7 +42,6 @@ class Base2 < Http
use ActionController::UrlFor
use ActionController::Renderer
use ActionController::Layouts
- use ActionController::ContentType
def self.inherited(klass)
::ActionController::Base2.subclasses << klass.to_s
Please sign in to comment.
Something went wrong with that request. Please try again.