Ruby on Rails
Tuesday, July 3, 2012
Hi
i hava a database tst with attributes d1 and d2
in an array a=["d1","d2"]
to get to the value of tst.d1 i can use
tst.send a[0].to_sym
how can i change the value of d1 in this way ?
something like
tst.send a[0].to_sym = "hello" ??
Thanks
--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment