Update array values in rails
I am new to rails and I was trying to update array values this way:
model.some_array[0] = "new value"
model.save
I found out thanks to this issues #14763 and #6172 that
you need to tell rails that the array will change before you change its value like so:
model.some_array_will_change!
Hope you find this useful
Written by carlosepp
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#