Example:
def somemethod(variable)
value = Record.find(:all)
value.each do |row|
row.colone = "foo"
row.coltwo = "bar"
row.__send__(variable) = "keke"
row.save!
end
end
somemethod(colthree)
=> unexpected '=', expecting kEND
I can't do row.variable, that will create an undefined method. What can
I do to place in the expected column?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---