-
Notifications
You must be signed in to change notification settings - Fork 403
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
form_with
default argument raises exception on Rails 8.0
#974
Comments
Hi @grantbdev, thanks for this issue It is unfortunate that none of the existing tests is catching this or the deprecation, not even with If you want to contribute with a PR, feel free to add the test and submit it and I will take a look. Otherwise I can take a look in the upcoming days |
tagliala
pushed a commit
that referenced
this issue
Jan 29, 2025
Ensure that super `form_with` is called with the right arguments. Fix #974
tagliala
added a commit
that referenced
this issue
Jan 29, 2025
* Fix CI * Fix: `form_with` with `validate: false` exception on Rails 8 Ensure that super `form_with` is called with the right arguments. Fix #974 * Update changelog and version * Enable CI --------- Co-authored-by: Maksim <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to reproduce*
Use
form_with
in a view without specifying a model and without specifyingvalidate: true
:Here is a regression test for
test/action_view/cases/test_form_with_helpers.rb
:Expected behavior*
The Rails fallback behavior should be used without any problem, like when the gem is not installed.
Actual behavior*
Deprecation warning on Rails 7.2:
Exception raised on Rails 8.0+:
System configuration*
Rails version: 7.2+
Ruby version: 3.3
Client Side Validations version: 22.3.0
I think this problem can be solved by changing the default
model
option inform_with
tofalse
to match the expected Rails default:https://github.com/DavyJonesLocker/client_side_validations/blob/v22.3.0/lib/client_side_validations/action_view/form_with_helper.rb#L7
I don't suspect there would be a backwards compatibility issue with this change.
The Rails change was initially made here: rails/rails#49943
It was changed to a deprecation warning for Rails 7.2 here: rails/rails#50931
The text was updated successfully, but these errors were encountered: