Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect morphing and scroll preservation settings when handling form errors #1061

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

jorgemanrubia
Copy link
Member

@jorgemanrubia jorgemanrubia commented Nov 9, 2023

Turbo will render 422 responses to allow handling form errors. A common scenario in Rails is to render those setting the satus like:

render "edit", status: :unprocessable_entity

This change will consider such operations a "page refresh" and will also consider the scroll directive.

Thanks to @seanpdoyle for the heads up in #1019 (comment).

…errors

Turbo will render 422 responses to allow handling form errors. A common scenario
in Rails is to render those setting the satus like:

```
render "edit", status: :unprocessable_entity
```

This change will consider such operations a "page refresh" and will also consider
the scroll directive.
@jorgemanrubia jorgemanrubia force-pushed the morph-refreshes-form-errors branch from 2f1193f to b77d283 Compare November 9, 2023 21:15
@jorgemanrubia jorgemanrubia merged commit ddfe38b into morph-refreshes Nov 9, 2023
2 checks passed
@jorgemanrubia jorgemanrubia deleted the morph-refreshes-form-errors branch November 9, 2023 21:16
@jorgemanrubia jorgemanrubia mentioned this pull request Nov 9, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant