format(view_path = [])
Returns the MIME type for the format used in the request.
GET /posts/5.xml | request.format => Mime::XML GET /posts/5.xhtml | request.format => Mime::HTML GET /posts/5 | request.format => Mime::HTML or MIME::JS, or request.accepts.first
# File actionpack/lib/action_dispatch/http/mime_negotiation.rb, line 52 def format(view_path = []) formats.first || Mime::NullType.instance end