diff options
author | José Valim <jose.valim@gmail.com> | 2009-07-29 19:31:03 +0200 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-07-29 12:06:04 -0700 |
commit | d209aea7d88849b7c7a080d729045ce7c051ef1f (patch) | |
tree | 4bc7ef559c9617c4835e4b6d585b460caf39520e | |
parent | fa0cf663fe6a6393a3ba117505703e587da4ddc5 (diff) | |
download | rails-d209aea7d88849b7c7a080d729045ce7c051ef1f.tar.gz rails-d209aea7d88849b7c7a080d729045ce7c051ef1f.tar.bz2 rails-d209aea7d88849b7c7a080d729045ce7c051ef1f.zip |
Remove last TODO.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
4 files changed, 3 insertions, 8 deletions
diff --git a/actionpack/lib/action_controller/base/mime_responds.rb b/actionpack/lib/action_controller/base/mime_responds.rb index 5a70931941..f4a4007a43 100644 --- a/actionpack/lib/action_controller/base/mime_responds.rb +++ b/actionpack/lib/action_controller/base/mime_responds.rb @@ -263,11 +263,7 @@ module ActionController #:nodoc: protected def respond_to_block_or_template_or_resource(format, resource, options) - # TODO It should be just: self.formats = [ :foo ] self.formats = [format.to_sym] - self.content_type = format - self.template.formats = [format.to_sym] - return yield if block_given? begin diff --git a/actionpack/lib/action_controller/base/renderer.rb b/actionpack/lib/action_controller/base/renderer.rb index 2fab501302..572da451ff 100644 --- a/actionpack/lib/action_controller/base/renderer.rb +++ b/actionpack/lib/action_controller/base/renderer.rb @@ -11,11 +11,10 @@ module ActionController def render(options) super - options[:_template] ||= _action_view._partial self.content_type ||= begin mime = options[:_template].mime_type formats.include?(mime && mime.to_sym) || formats.include?(:all) ? mime : Mime::Type.lookup_by_extension(formats.first) - end + end.to_s response_body end diff --git a/actionpack/lib/action_dispatch/http/mime_type.rb b/actionpack/lib/action_dispatch/http/mime_type.rb index 27f27e27fe..cc989d6625 100644 --- a/actionpack/lib/action_dispatch/http/mime_type.rb +++ b/actionpack/lib/action_dispatch/http/mime_type.rb @@ -84,7 +84,7 @@ module Mime end def lookup_by_extension(extension) - EXTENSION_LOOKUP[extension] + EXTENSION_LOOKUP[extension.to_s] end # Registers an alias that's not used on mime type lookup, but can be referenced directly. Especially useful for diff --git a/actionpack/test/controller/mime_responds_test.rb b/actionpack/test/controller/mime_responds_test.rb index 558fc47695..117f4ea4f0 100644 --- a/actionpack/test/controller/mime_responds_test.rb +++ b/actionpack/test/controller/mime_responds_test.rb @@ -443,7 +443,7 @@ class RespondToControllerTest < ActionController::TestCase @action = args.first[:action] unless args.empty? @action ||= action_name - response.body = "#{@action} - #{@template.formats}" + response.body = "#{@action} - #{formats}" end end |