format=(extension) Instance Public methods Sets the format by string extension, which can be used to force custom formats that are not controlled by the extension. class ApplicationController < ActionController::Base before_action :adjust_format_for_iphone private def adjust_format_for_iphone request.format = :iphone if request.env["HTTP_USER_AGENT"][/iPhone/] end end
format(view_path = []) Instance Public methods 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
content_type() Instance Public methods
content_mime_type() Instance Public methods The MIME type of the HTTP request, such as Mime::XML. For backward compatibility, the post format is extracted from the X-Post-Data-Format HTTP header if present.
accepts() Instance Public methods Returns the accepted MIME type for the request.
merge!(headers_or_env) Instance Public methods
merge(headers_or_env) Instance Public methods
key?(key) Instance Public methods Also aliased as: include?
include?(key) Instance Public methods Alias for: key?
fetch(key, *args, &block) Instance Public methods
Page 361 of 2275