You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This confusing to talk/think about. But some things have been a bit inconvenient with form handling, that we can possibly take care of with our _attributes= methods, which are of course pretty much just there for form handling (I think?), via Rails analogy for associations using _attributes= methods.
if i have a nested object on a form, and ALL it's inputs are left empty, I really want to remove it from the DB, not leave it in the DB with all empty-string attributes
for a single (not array) embedded model... if I leave all the inputs empty, I want to DELETE it, not just leave it there empty
For a single (not array) embedded model, an easier way to make a form taht automatically "builds" it when needed?
Not sure if these would be universal wants. Or if they'd need to be configurable somehow.
even without nested models, do I want empty strings in the DB instead of nil when form is submitted with nothing in the box? (But this is an issue with ordinary Rails too? How does Rails handle it?)
In general, to "solve" this I'd want to spend some more time testing what Rails does in "ordinary" circumstances, including to_many and has_one inline editing... if possible, it would be nice to match rails, but if what Rails does is too un-helpful, we coudl maybe do better/different.
The text was updated successfully, but these errors were encountered:
OK, we're not going to do anything else with this right now. #175 took a stab off it.
We might in the future do something with a "normalization" API; in AttrJson v2 the upcoming Rails 7.1 normalizes feature should actually work with AttrJson::Record attributes, so would be one way to strip empty strings. As it won't for now be useable in non-ActiveRecord ActiveModel classes... we may want to provide something similar in the future ourselves. It's not going to be in 2.0.
This confusing to talk/think about. But some things have been a bit inconvenient with form handling, that we can possibly take care of with our
_attributes=
methods, which are of course pretty much just there for form handling (I think?), via Rails analogy for associations using_attributes=
methods.Not sure if these would be universal wants. Or if they'd need to be configurable somehow.
In general, to "solve" this I'd want to spend some more time testing what Rails does in "ordinary" circumstances, including to_many and has_one inline editing... if possible, it would be nice to match rails, but if what Rails does is too un-helpful, we coudl maybe do better/different.
The text was updated successfully, but these errors were encountered: