Lol don’t ask why but I would like to use to code I found on the forum
to copy two values from table A to table B. It looks a bit roundabout
but it doesn’t matter to me.
Okay so I know that this part goes in the controller class(i dont think
I have to modify it at all?):
def copy_attributes(dest, src, *attrs)
for attr in attrs
dest.send(attr.to_s + ‘=’,src.send(attr))
Then where does this line of code go/how do I execute the copy? Would I
include it in def new, or between the “ends” in the above code, or wrap
it in <=% %> tags in the view.
copy_attributes(bidule, biniou, :foo, :bar, :baz)