PDA

View Full Version : Getting column names from a record set


clem_c_rock
March 2nd, 2007, 12:27 PM
Hello,

I'm trying to get the column names associated w/ this record set:


account_all = Account.find(:all)


Since account_all is an array - how do I get the names?


I know there's got to be a simple way to do this.

clem_c_rock
March 2nd, 2007, 01:15 PM
Sweet - here's what I was looking for:

account_all.first.attributes.keys