Hi -
I am adding a series of records within a for loop using i as my
counter. Rather than hard code the model attributes I would like to
dynamically create them.
Here’s what I’m trying to do:
I have several fields on my example model named such as:
spec_1_english
spec_2_english
etc…
This is what I would like to do - create these attributes dynamically
using my counter.
for i in (0…2)
example.spec_#{i}_english = “test value”
l.save
end
Any help appreciated.
Thanks!