1
0
Fork 0
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:
Yehuda Katz + Carl Lerche 2009-04-29 17:50:11 -07:00
parent b98e496c03
commit d58b57a3ca
4 changed files with 6 additions and 21 deletions

View file

@ -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 file

@ -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 file

@ -24,7 +24,9 @@ module ActionController
options[:_prefix] = _prefix
end
super(options)
ret = super(options)
response.content_type ||= options[:_template].mime_type
ret
end
private
@ -43,9 +45,9 @@ module ActionController
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 file

@ -42,7 +42,6 @@ module ActionController
use ActionController::UrlFor
use ActionController::Renderer
use ActionController::Layouts
use ActionController::ContentType
def self.inherited(klass)
::ActionController::Base2.subclasses << klass.to_s