instance method
negotiate_mime
Ruby on Rails 3.0.20
Since v3.0.20Signature
negotiate_mime(order)
Receives an array of mimes and return the first user sent mime that matches the order array.
Parameters
-
orderreq
Source
# File actionpack/lib/action_dispatch/http/mime_negotiation.rb, line 77
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) ? formats.first : nil
end
Defined in actionpack/lib/action_dispatch/http/mime_negotiation.rb line 77
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::Http::MimeNegotiation