instance method
fields
Ruby on Rails 7.1.6
Since v5.2.8.1Signature
fields(scope = nil, model: nil, **options, &block)
See the docs for the ActionView::Helpers::FormHelper#fields helper method.
Parameters
-
scopeopt = nil -
modelkey = nil -
optionskeyrest -
blockblock
Source
# File actionview/lib/action_view/helpers/form_helper.rb, line 2322
def fields(scope = nil, model: nil, **options, &block)
options[:allow_method_names_outside_object] = true
options[:skip_default_ids] = !FormHelper.form_with_generates_ids
convert_to_legacy_options(options)
fields_for(scope || model, model, options, &block)
end
Defined in actionview/lib/action_view/helpers/form_helper.rb line 2322
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::Helpers::FormBuilder