-
Notifications
You must be signed in to change notification settings - Fork 115
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
inputs_for should not iterate over deleted entries #23
Comments
I am not sure I agree here. If the child model was deleted, I want to show If you want to skip it, you can maybe skip it yourself and not generate There is an article on blog.plataformatec.com.br that covers exactly this. José Valim |
@josevalim In my case contents of a form must always replace whatever is in the model. Maybe I'm cooking it wrong, but instead of getting the contents replaced, I'm getting the new stuff plus the old stuff. |
@josevalim I've reviewed the case from the article and there is nothing in contradiction with my proposal. In my case some items in the changeset already have |
@sumerman well, those two ways of doing things are conflicting because one the delete action is marked as part of the input while the other is already marked as deleted. I can think of two solutions to this problem:
Thoughts? |
@josevalim I still don't see the conflict. To my understanding "delete action is marked as part of the input" case, at least its implementation from article, does not involve changeset's action until the very end and input is carried inside a virtual field. On a contrary, I can think of using both approaches simultaneously:
If you really want to make this a flag, I would like to have P.S.: sorry if something is not clear, I'm a bit sleepy now. |
@sumerman yes, however, if I fix your use case, my use case will be broken. I am certain, I just tried. :) So something gotta give. :) P.S.: me too. let's continue this tomorrow! |
@josevalim I'm ok with |
@sumerman I am working on this and I have a question. Imagine that I have a deleted changeset in a has_one relationship. Should we show the |
@josevalim if you are talking about |
Can you please give master a try and let me know if works as expected? I want to fix the other issue and ship 2.1 along side ecto 0.16. |
@josevalim master works fine. thanks! |
Similar to elixir-ecto/ecto#875.
The text was updated successfully, but these errors were encountered: