Method: Merb::ResponderMixin::ClassMethods#provides
- Defined in:
- lib/merb-core/controller/mixins/responder.rb
#provides(*formats) ⇒ Object
Adds symbols representing formats to the controller’s default list of provided_formats. These will apply to every action in the controller, unless modified in the action. If the last argument is a Hash or an Array, these are regarded as arguments to pass to the to_<mime_type> method as needed.
Parameters
- *formats<Symbol>
-
A list of mime-types that the controller should provide.
Returns
- Array
-
List of formats passed in.
Examples
provides :html, :xml
:api: public
139 140 141 |
# File 'lib/merb-core/controller/mixins/responder.rb', line 139 def provides(*formats) self.class_provided_formats |= formats end |