-
Notifications
You must be signed in to change notification settings - Fork 26
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
The forme_set plugin remembers columns from another form on the same page #109
Comments
Seems like this is because Forme inputs are being stored on the Sequel model instance, so they persisted from the previous form: forme/lib/sequel/plugins/forme_set.rb Lines 22 to 25 in d3b4da5
|
This behavior is currently expected, though apparently it isn't listed in the Caveats section of the documentation. In this case, you should avoid using However, it may be possible to change things for the Roda forme_set plugin so that the hidden input only includes inputs added to the model object during the form. This will require some care to be backwards compatible, so that only the hidden input is affected, and the model object still has inputs from all forms after processing. |
If changes could be made for multiple forms to work, in a way that's backwards compatible, that would be great 👌🏻 |
Agreed. I'll try to work on this this week. |
Perfect, thanks for the quick fix! |
I have two forms for an Expense records, one for updating the amount, the other for updating the note describing the expense. The first form has only the field for the amount, while the second has only the field for the note. However, when I render both forms on the same page, and submit the second one, it tries to nullify the amount field.
Here is a self-contained example demonstrating this issue:
When I inspect the HTML, the
_forme_set_data
field in the second form has"columns":["amount", "note"]
, instead of just["note"]
. I expected forms to be fully self-contained, where rendering one form won't affect the other. Can this be considered a bug?The text was updated successfully, but these errors were encountered: