ActionView::Helpers::FormHelper
form_with
API docs (Rails 8.1.4.1) ↗def form_with(model: false, scope: nil, url: nil, format: nil, **options, &block)
Description
Creates a <form> and outputs the content of the block inside it.
ERB
Changes from the previous output: Added Removed Changed
Controller action
@article = Article.new
Controller action
@article = Article.find(1)
HTML
Preview
Interacting with the preview updates the form submission.
Form submission
Form data
| name | value |
|---|
Request body
Content-Type:
params
This site hides the CSRF token as
(hidden). The real token is a long string that changes on every render.