diff options
Diffstat (limited to 'actionpack/lib/action_controller/base')
-rw-r--r-- | actionpack/lib/action_controller/base/mime_responds.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/base/mime_responds.rb b/actionpack/lib/action_controller/base/mime_responds.rb index dff4d7b943..ece4920a23 100644 --- a/actionpack/lib/action_controller/base/mime_responds.rb +++ b/actionpack/lib/action_controller/base/mime_responds.rb @@ -146,12 +146,12 @@ module ActionController #:nodoc: # # Mime::Type.register "image/jpg", :jpg def respond_to(*mimes, &block) + raise ArgumentError, "respond_to takes either types or a block, never both" if mimes.any? && block_given? responder = Responder.new - block.call(responder) if block_given? mimes = collect_mimes_from_class_level if mimes.empty? - mimes.each { |mime| responder.send(mime) } + mimes.each { |mime| responder.custom(mime) } if format = request.negotiate_mime(responder.order) # TODO It should be just: self.formats = [ :foo ] |