diff options
author | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-04-29 17:50:11 -0700 |
---|---|---|
committer | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-05-01 17:31:02 -0700 |
commit | d58b57a3caf4ad434c2be4f63eecd9a1921c7c4a (patch) | |
tree | 9a014c7443ae6fe4e6f780e291f328501baa9780 /actionpack/lib | |
parent | b98e496c039b7bde4a2de9c02809e0b4ee0679ae (diff) | |
download | rails-d58b57a3caf4ad434c2be4f63eecd9a1921c7c4a.tar.gz rails-d58b57a3caf4ad434c2be4f63eecd9a1921c7c4a.tar.bz2 rails-d58b57a3caf4ad434c2be4f63eecd9a1921c7c4a.zip |
Move ContentType inline for now.
Trying to avoid premature proliferation of modules.
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/new_base.rb | 1 | ||||
-rw-r--r-- | actionpack/lib/action_controller/new_base/content_type.rb | 15 | ||||
-rw-r--r-- | actionpack/lib/action_controller/new_base/renderer.rb | 10 |
3 files changed, 6 insertions, 20 deletions
diff --git a/actionpack/lib/action_controller/new_base.rb b/actionpack/lib/action_controller/new_base.rb index 9c8a6d0216..bfd8120e10 100644 --- a/actionpack/lib/action_controller/new_base.rb +++ b/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" diff --git a/actionpack/lib/action_controller/new_base/content_type.rb b/actionpack/lib/action_controller/new_base/content_type.rb deleted file mode 100644 index d2206a31af..0000000000 --- a/actionpack/lib/action_controller/new_base/content_type.rb +++ /dev/null @@ -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
\ No newline at end of file diff --git a/actionpack/lib/action_controller/new_base/renderer.rb b/actionpack/lib/action_controller/new_base/renderer.rb index 096a63e406..f21fd746b7 100644 --- a/actionpack/lib/action_controller/new_base/renderer.rb +++ b/actionpack/lib/action_controller/new_base/renderer.rb @@ -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 |