aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/mime_responds.rb
diff options
context:
space:
mode:
authorYehuda Katz <wycats@gmail.com>2009-01-22 16:18:10 -0600
committerJoshua Peek <josh@joshpeek.com>2009-01-22 16:18:10 -0600
commiteb9af20b7cc0e374277cf330bdd404f9daab28ec (patch)
treeba05a906690684e442ed92db3e63e295f0dd133e /actionpack/lib/action_controller/mime_responds.rb
parentcc0b5fa9930dcc60914e21b518b3c54109243cfa (diff)
downloadrails-eb9af20b7cc0e374277cf330bdd404f9daab28ec.tar.gz
rails-eb9af20b7cc0e374277cf330bdd404f9daab28ec.tar.bz2
rails-eb9af20b7cc0e374277cf330bdd404f9daab28ec.zip
Begin unifying the interface between ActionController and ActionView
Diffstat (limited to 'actionpack/lib/action_controller/mime_responds.rb')
-rw-r--r--actionpack/lib/action_controller/mime_responds.rb9
1 files changed, 3 insertions, 6 deletions
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