ActionView::Helpers::FormTagHelper
def field_name(object_name, method_name, *method_names, multiple: false, index: nil)

Description

Returns a name value as a string, in the same format that text_field and other FormHelper helpers use.

Arguments

Changing a value updates the ERB and HTML.

The first part of the name. If it is an empty string, the name starts with method_name, without [] around it.
method_name:tags
Added after object_name, wrapped in [].
= nil
:subtitle
Added after method_name, each wrapped in []. You can pass any number of them.
= false
true
true adds [] to the end.
= nil
0
Added after object_name, wrapped in []. If object_name is empty, it is not added.

ERB

Changes from the previous output: Added Removed Changed


          

HTML


          

Preview

Interacting with the preview updates the form submission.

Form submission

Form data

namevalue
Request body

Content-Type:


              

params