instance method
negotiate_mime
Ruby on Rails 7.2.3
Since v3.0.20Signature
negotiate_mime(order)
Returns the first MIME type that matches the provided array of MIME types.
Parameters
-
orderreq
Source
# File actionpack/lib/action_dispatch/http/mime_negotiation.rb, line 148
def negotiate_mime(order)
formats.each do |priority|
if priority == Mime::ALL
return order.first
elsif order.include?(priority)
return priority
end
end
order.include?(Mime::ALL) ? format : nil
end
Defined in actionpack/lib/action_dispatch/http/mime_negotiation.rb line 148
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::Http::MimeNegotiation