Skip to content

Document form handling - #17

Closed
samuel-williams-shopify wants to merge 2 commits into
mainfrom
document-form-handling
Closed

samuel-williams-shopify wants to merge 2 commits into
mainfrom
document-form-handling

Conversation

@samuel-williams-shopify

@samuel-williams-shopify samuel-williams-shopify commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Description

Document form submission using Live::Element#forward_form_event, including the forwarded event shape, repeated form controls, submit-button values, and normal HTTP fallback.

Add the example form to the resolver used by the getting-started guide. This keeps form handling within the existing view/event model rather than introducing a specialized Live::Form.

Uses the Ruby-style event[:form_data] interface introduced by socketry/live-js#6, which should merge first.

Fixes #4.

Testing

ruby -c on the documented ContactForm example

bundle exec bake decode:index:coverage lib

bundle exec sus test/live/element.rb test/live/page.rb test/live/resolver.rb test/live/view.rb

Signed-off-by: Samuel Williams <samuel.williams@shopify.com>
Assisted-By: devx/7ef83274-928f-499d-b668-48449b1ff60e
Signed-off-by: Samuel Williams <samuel.williams@shopify.com>
Assisted-By: devx/7ef83274-928f-499d-b668-48449b1ff60e
@samuel-williams-shopify

Copy link
Copy Markdown
Contributor Author

Closing because the documented interface depended on socketry/live-js#6. We will retain instead.

@samuel-williams-shopify

Copy link
Copy Markdown
Contributor Author

Clarification: closing because the documented form_data interface depended on socketry/live-js#6. We will retain formData instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handling forms.

1 participant