mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Move ContentType inline for now.
Trying to avoid premature proliferation of modules.
This commit is contained in:
parent
b98e496c03
commit
d58b57a3ca
4 changed files with 6 additions and 21 deletions
|
@ -1,5 +1,4 @@
|
||||||
module ActionController
|
module ActionController
|
||||||
autoload :ContentType, "action_controller/new_base/content_type"
|
|
||||||
autoload :HideActions, "action_controller/new_base/hide_actions"
|
autoload :HideActions, "action_controller/new_base/hide_actions"
|
||||||
autoload :Http, "action_controller/new_base/base"
|
autoload :Http, "action_controller/new_base/base"
|
||||||
autoload :Layouts, "action_controller/new_base/layouts"
|
autoload :Layouts, "action_controller/new_base/layouts"
|
||||||
|
|
|
@ -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
|
|
|
@ -24,7 +24,9 @@ module ActionController
|
||||||
options[:_prefix] = _prefix
|
options[:_prefix] = _prefix
|
||||||
end
|
end
|
||||||
|
|
||||||
super(options)
|
ret = super(options)
|
||||||
|
response.content_type ||= options[:_template].mime_type
|
||||||
|
ret
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -43,9 +45,9 @@ module ActionController
|
||||||
end
|
end
|
||||||
|
|
||||||
def _process_options(options)
|
def _process_options(options)
|
||||||
if status = options[:status]
|
status, content_type = options.values_at(:status, :content_type)
|
||||||
response.status = status.to_i
|
response.status = status.to_i if status
|
||||||
end
|
response.content_type = content_type if content_type
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -42,7 +42,6 @@ module ActionController
|
||||||
use ActionController::UrlFor
|
use ActionController::UrlFor
|
||||||
use ActionController::Renderer
|
use ActionController::Renderer
|
||||||
use ActionController::Layouts
|
use ActionController::Layouts
|
||||||
use ActionController::ContentType
|
|
||||||
|
|
||||||
def self.inherited(klass)
|
def self.inherited(klass)
|
||||||
::ActionController::Base2.subclasses << klass.to_s
|
::ActionController::Base2.subclasses << klass.to_s
|
||||||
|
|
Loading…
Reference in a new issue