Collects mimes and return the response for the negotiated format. Returns
nil if :not_acceptable was sent to the client.
# File actionpack/lib/action_controller/metal/mime_responds.rb, line 267
def retrieve_collector_from_mimes(mimes=nil, &block) #:nodoc:
mimes ||= collect_mimes_from_class_level
collector = Collector.new(mimes)
block.call(collector) if block_given?
format = collector.negotiate_format(request)
if format
self.content_type ||= format.to_s
lookup_context.formats = [format.to_sym]
lookup_context.rendered_format = lookup_context.formats.first
collector
else
head :not_acceptable
nil
end
end