module ActionDispatch::Http::MimeNegotiation
def format(view_path = [])
GET /posts/5 | request.format => Mime::HTML or MIME::JS, or request.accepts.first
GET /posts/5.xhtml | request.format => Mime::HTML
GET /posts/5.xml | request.format => Mime::XML
Returns the MIME type for the \format used in the request.
def format(view_path = []) formats.first end