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 have 4 translation in my site and 4 tabs for them. When I try create news for example with one translation and I save it it also create 3 another as "" strings.
How I can save just not void translations?
The text was updated successfully, but these errors were encountered:
I was looking for the same answer. I made a proof of concept with this before filter:
# Model is Articlebefore_filteronly: [:create,:update]doparams[:article][:translations_attributes].delete_ifdo |k,v|
v.except('id','locale').all?{ |_,v| v.blank?}endend
While this works I don't like this solution. Another option would be to insert some javascript that does the same thing but client side disabling or removing empty elements from the submitted values.
@stefanoverna what do you think? I can try to work with javascript if it's fine for you.
I have 4 translation in my site and 4 tabs for them. When I try create
news
for example with one translation and I save it it also create 3 another as""
strings.How I can save just not void translations?
The text was updated successfully, but these errors were encountered: