class Collector
Ruby on Rails 6.0.6
Since v4.0.13A container for responses available from the current controller for requests for different mime-types sent to a particular action.
The public controller methods 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.
Inherits from
Includes
Attributes
Methods (defined here)
Methods (inherited)
From AbstractController::Collector (1)
- self. generate_method_for_mime
From Object (17)
- # acts_like?
- # blank?
- # deep_dup
- # duplicable?
- # html_safe?
- # in?
- # instance_values
- # instance_variable_names
- # presence
- # presence_in
- # present?
- # to_param
- # to_query
- # try
- # try!
- # unescape
- # with_options