ActionView::Helpers::FormHelper
Inherits ActionView::Helpers::FormTagHelper < ActionView::Helpers::FormOptionsHelper < ActionView::Helpers::TagHelper < ActionView::Helpers::TagHelper < ActionView::Helpers::TagHelper
Class methods
Rails 8.1 defaults; apps on load_defaults 6.1+/8.x set these to false/true respectively (local forms, generated ids).
Rails 8.1 defaults; apps on load_defaults 6.1+/8.x set these to false/true respectively (local forms, generated ids).
Polymorphic model→path resolver (the Rails polymorphic_path
analogue): installed by railties_cr at boot, pointing at
CRails::Routes::UrlHelpers. action_view_cr cannot see the route
set itself (the dependency runs the other way — action_pack_cr
depends on action_view_cr). nil → form_with model: without
url: raises ArgumentError.
Polymorphic model→path resolver (the Rails polymorphic_path
analogue): installed by railties_cr at boot, pointing at
CRails::Routes::UrlHelpers. action_view_cr cannot see the route
set itself (the dependency runs the other way — action_pack_cr
depends on action_view_cr). nil → form_with model: without
url: raises ArgumentError.
Instance methods
fields — form_with's scoped builder WITHOUT the form tag (Rails
7.1+ fields; oracle fields_*). Unlike fields_for, ids follow the
form_with config (form_with_generates_ids), and model: may be an
array — the LAST model drives the scope. url: is accepted for
signature parity and ignored (no form tag to attach it to).
fields_for — view-level scoped fields without a form tag (oracle: ff_view* cases). Like form_with's builder, except ids ARE generated (Rails fields_for resets skip_default_ids).
form_for — the legacy form helper (oracle ffor_*): field ids
ALWAYS generated, dom class (edit_/new_ + the LAST model's
name) and dom id (edit_post_7 / new_post) on the form tag, local
form (no data-remote). html: opts merge in before
enctype/action — a user class REPLACES the dom class (Rails
semantics). Attribute order: class, id, [html opts], enctype,
action, accept-charset, method.
form_with url: "/x" do |f| ... end — capture-first: the block is rendered into a string before the open tag so file_field can flip the multipart flag. Attribute order per Rails: user opts, enctype, action, accept-charset, [data-remote], method (oracle fw_local / fw_file_multipart). Returns "" — the whole form goes to the output buffer in one piece.