From eb9af20b7cc0e374277cf330bdd404f9daab28ec Mon Sep 17 00:00:00 2001 From: Yehuda Katz Date: Thu, 22 Jan 2009 16:18:10 -0600 Subject: Begin unifying the interface between ActionController and ActionView --- actionpack/lib/action_controller/mime_responds.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'actionpack/lib/action_controller/mime_responds.rb') diff --git a/actionpack/lib/action_controller/mime_responds.rb b/actionpack/lib/action_controller/mime_responds.rb index b755363873..bac225ab2a 100644 --- a/actionpack/lib/action_controller/mime_responds.rb +++ b/actionpack/lib/action_controller/mime_responds.rb @@ -109,16 +109,13 @@ module ActionController #:nodoc: end class Responder #:nodoc: + def initialize(controller) @controller = controller @request = controller.request @response = controller.response - if ActionController::Base.use_accept_header - @mime_type_priority = Array(Mime::Type.lookup_by_extension(@request.parameters[:format]) || @request.accepts) - else - @mime_type_priority = [@request.format] - end + @mime_type_priority = @request.formats @order = [] @responses = {} @@ -130,7 +127,7 @@ module ActionController #:nodoc: @order << mime_type @responses[mime_type] ||= Proc.new do - @response.template.template_format = mime_type.to_sym + @response.template.formats = [mime_type.to_sym] @response.content_type = mime_type.to_s block_given? ? block.call : @controller.send(:render, :action => @controller.action_name) end -- cgit v1.2.3