Module | ActionController::ParamsWrapper::ClassMethods |
In: |
lib/action_controller/metal/params_wrapper.rb
|
Sets the default wrapper key or model which will be used to determine wrapper key and attribute names. Will be called automatically when the module is inherited.
Sets the name of the wrapper key, or the model which ParamsWrapper would use to determine the attribute names from.
wrap_parameters :format => :xml # enables the parameter wrapper for XML format wrap_parameters :person # wraps parameters into +params[:person]+ hash wrap_parameters Person # wraps parameters by determining the wrapper key from Person class (+person+, in this case) and the list of attribute names wrap_parameters :include => [:username, :title] # wraps only +:username+ and +:title+ attributes from parameters. wrap_parameters false # disables parameters wrapping for this controller altogether.