instance method
_set_wrapper_defaults
Ruby on Rails 3.1.12
Since v3.1.12 Last seen in v3.2.22.5Available in: v3.1.12 v3.2.22.5
Signature
_set_wrapper_defaults(options, model=nil)
No documentation comment.
Parameters
-
optionsreq -
modelopt = nil
Source
# File actionpack/lib/action_controller/metal/params_wrapper.rb, line 163
def _set_wrapper_defaults(options, model=nil)
options = options.dup
unless options[:include] || options[:exclude]
model ||= _default_wrap_model
if model.respond_to?(:attribute_names) && model.attribute_names.present?
options[:include] = model.attribute_names
end
end
unless options[:name] || self.anonymous?
model ||= _default_wrap_model
options[:name] = model ? model.to_s.demodulize.underscore :
controller_name.singularize
end
options[:include] = Array.wrap(options[:include]).collect(&:to_s) if options[:include]
options[:exclude] = Array.wrap(options[:exclude]).collect(&:to_s) if options[:exclude]
options[:format] = Array.wrap(options[:format])
self._wrapper_options = options
end
Defined in actionpack/lib/action_controller/metal/params_wrapper.rb line 163
· View on GitHub
· Improve this page
· Find usages on GitHub