Type:
Class

A container for responses available from the current controller for requests for different mime-types sent to a particular action.

The public controller methods respond_with and respond_to may be called with a block that is used to define responses to different mime-types, e.g. for respond_to :

respond_to do |format|
  format.html
  format.xml { render xml: @people }
end

In this usage, the argument passed to the block (format above) is an instance of the ActionController::MimeResponds::Collector class. This object serves as a container in which available responses can be stored by calling any of the dynamically generated, mime-type-specific methods such as html, xml etc on the Collector. Each response is represented by a corresponding block if present.

A subsequent call to negotiate_format(request) will enable the Collector to determine which specific mime-type it should respond with for the current request, with this response then being accessible by calling response.

any

any(*args, &block) Instance Public methods Also aliased as:

2015-06-20 00:00:00
negotiate_format

negotiate_format(request) Instance Public methods

2015-06-20 00:00:00
custom

custom(mime_type, &block) Instance Public methods

2015-06-20 00:00:00
new

new(mimes, variant = nil) Class Public methods

2015-06-20 00:00:00
response

response() Instance Public methods

2015-06-20 00:00:00
all

all(*args, &block) Instance Public methods Alias for:

2015-06-20 00:00:00