method
wrap_parameters
v7.1.3.2 -
Show latest stable
-
0 notes -
Class: ClassMethods
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0
- 3.0.9
- 3.1.0 (0)
- 3.2.1 (6)
- 3.2.8 (0)
- 3.2.13 (0)
- 4.0.2 (-38)
- 4.1.8 (0)
- 4.2.1 (0)
- 4.2.7 (0)
- 4.2.9 (0)
- 5.0.0.1 (0)
- 5.1.7 (0)
- 5.2.3 (0)
- 6.0.0 (0)
- 6.1.3.1 (13)
- 6.1.7.7 (0)
- 7.0.0 (0)
- 7.1.3.2 (0)
- 7.1.3.4 (0)
- What's this?
wrap_parameters(name_or_model_or_options, options = {})
public
Sets the name of the wrapper key, or the model which ParamsWrapper would use to determine the attribute names from.
Examples
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.
Options
-
:format - The list of formats in which the parameters wrapper will be enabled.
-
:include - The list of attribute names which parameters wrapper will wrap into a nested hash.
-
:exclude - The list of attribute names which parameters wrapper will exclude from a nested hash.