Connecting Tech Pros Worldwide Forums | Help | Site Map

how to create a ruby variable from a database column entry

Member
 
Join Date: Jun 2007
Posts: 47
#1: Apr 5 '08
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

Member
 
Join Date: Jun 2007
Posts: 47
#2: Apr 5 '08

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


got it!

Mystuff.find(:id).title
Reply