Hi all, I made this array: @army_types = ["ss","s","xl","l","m","w","xw"] but, I want to be able to go like this @army_types.each do |st| @user.st end but, I get the error that "@user.st" st is not a valid feild for the table user. Is there a way to get around MySQL running it first?
on 2006-05-08 22:11
on 2006-05-08 22:18
It's not entirely clear to my what you want to do. But if I understand correctly, you should try this: @army_types.each do |st| @user.send(st) end
on 2006-05-08 22:31
Carl-Johan Kihlbom wrote: > It's not entirely clear to my what you want to do. But if I understand > correctly, you should try this: > > @army_types.each do |st| > @user.send(st) > end Thanks this worked