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
I use the latest version of the gem. I have a view with three text fields, one for every language. If I want to submit the form where one text field (e.g. language field English) is filled out and the other two are empty, then the changes are not stored in database. I have checked the params and all three fields are present in the params. English field has a content the other two are empty.
Project has many tasks as nested fields. The model Project accepts nested attributes for tasks.
If I delete the rows in table task_translations related to the tasks and re-submit the form, all works fine. Any idea?
The text was updated successfully, but these errors were encountered:
phlegx
changed the title
Single language field accepts_nested_attributes_for single language field
Single language field with accepts_nested_attributes_for not stored
Jan 3, 2017
Hi there, my reply seems to be 2 years late. But I would like to share my experience on what happened on my implementation that caused accepts_nested_attributes_for to not work.
Imagine the relation of a Product has many Promotion.
I have implemented a .each method on the promotions at the Product model's before_save. Which caused it to delegate to ActiveRecord's CollectionProxy method:
Hi!
I use the latest version of the gem. I have a view with three text fields, one for every language. If I want to submit the form where one text field (e.g. language field English) is filled out and the other two are empty, then the changes are not stored in database. I have checked the params and all three fields are present in the params. English field has a content the other two are empty.
Project
has manytasks
as nested fields. The modelProject
accepts nested attributes for tasks.My
Task
model:If I delete the rows in table
task_translations
related to the tasks and re-submit the form, all works fine. Any idea?The text was updated successfully, but these errors were encountered: