Connecting Tech Pros Worldwide Help | Site Map

how to create a ruby variable from a database column entry

  #1  
Old April 5th, 2008, 09:32 AM
Member
 
Join Date: Jun 2007
Posts: 47
Hi Guys,

I am trying to get up to speed with Rails and enjoying it so far

One thing I cant work out so far and has eaten up most of my day!:
how to find an entry in a database and set it as a ruby variable?

I want to find the 'title' an an id/entry in my mysql DB and then use ruby to create a directory on my machine with that title as the name

Any ideas? I hope that makes some sense!

Cheers!

Adam
  #2  
Old April 5th, 2008, 10:38 AM
Member
 
Join Date: Jun 2007
Posts: 47

re: how to create a ruby variable from a database column entry


got it!

Mystuff.find(:id).title
Reply