From: Florian Gilcher Date: 2008-03-01T06:09:05+09:00 Subject: Re: Model Commands On Feb 29, 2008, at 10:01 PM, Mariko C. wrote: > I'd like to do something like this in my RoR code: > > > name = "james" > box = Box.find(1) > box_name = box.name > > Where "james" is an existing column in table Box. I try to do this but > RoR tells me "undefined method `name' for #". Is it > possible to get around this? Basically what I have is a list of > strings > that I need to use as column commands. > > Thanks in advance for any help. > -- > Posted via http://www.ruby-forum.com/. > You want to send a message with to the method "james". What you are doing is sending a message to the method "name". What you want to do is: === code === name = "james" box = Box.find(1) box_name = box.send(name) === code === I don't know what you want to acomplish, but this is how it works. Greetings Florian Gilcher