retrieve_response_from_mimes(mimes=nil, &block)
protected
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 260
def retrieve_response_from_mimes(mimes=nil, &block)
collector = Collector.new { default_render }
mimes ||= collect_mimes_from_class_level
mimes.each { |mime| collector.send(mime) }
block.call(collector) if block_given?
if format = request.negotiate_mime(collector.order)
self.content_type ||= format.to_s
lookup_context.freeze_formats([format.to_sym])
collector.response_for(format)
else
head :not_acceptable
nil
end
end