diff options
author | Prem Sichanugrist <s@sikachu.com> | 2012-03-05 21:06:02 -0500 |
---|---|---|
committer | Prem Sichanugrist <s@sikachu.com> | 2012-03-05 21:06:02 -0500 |
commit | 284041cf91a3b2c2d041e71e86fec467080ea9be (patch) | |
tree | 021f66612bef8de5c2f2db84e01b6ba3b0fbfd43 /actionpack/lib/action_controller/metal/mime_responds.rb | |
parent | 4c31ba93863e538d65c07f55e0c6ea356aee8f3a (diff) | |
download | rails-284041cf91a3b2c2d041e71e86fec467080ea9be.tar.gz rails-284041cf91a3b2c2d041e71e86fec467080ea9be.tar.bz2 rails-284041cf91a3b2c2d041e71e86fec467080ea9be.zip |
Always passing a respond block from to responder
We should let the responder to decide what to do with the given
overridden response block, and not short circuit it.
Fixes #5280
Diffstat (limited to 'actionpack/lib/action_controller/metal/mime_responds.rb')
-rw-r--r-- | actionpack/lib/action_controller/metal/mime_responds.rb | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/actionpack/lib/action_controller/metal/mime_responds.rb b/actionpack/lib/action_controller/metal/mime_responds.rb index cb59af4f85..b423807f91 100644 --- a/actionpack/lib/action_controller/metal/mime_responds.rb +++ b/actionpack/lib/action_controller/metal/mime_responds.rb @@ -235,16 +235,8 @@ module ActionController #:nodoc: if collector = retrieve_collector_from_mimes(&block) options = resources.size == 1 ? {} : resources.extract_options! - - if defined_response = collector.response - if action = options.delete(:action) - render :action => action - else - defined_response.call - end - else - (options.delete(:responder) || self.class.responder).call(self, resources, options) - end + options[:default_response] = collector.response + (options.delete(:responder) || self.class.responder).call(self, resources, options) end end |