Trying to print out a simple database grid, using, with column headers
such as ‘SunToSatRoles’, ‘PrimaryRoles’, etcetera.
Iterating through an object @List which is populated thusly
@list = mymodel.find(:all, :order => mymodel.editlist_order)
When I do something like
<%= i.inspect %> |
I get
#“Spaghetti”, “sunToSatRoles”=>nil, “currentRole”=>“Q”, “group_id”=>nil,
“id”=>“3”, “loggedIn”=>“1”, “baseRole”=>“O”, “monDtlDef_id”=>nil}>
#“name”, “sunToSatRoles”=>nil, “currentRole”=>nil, “group_id”=>nil,
“id”=>“2”, “loggedIn”=>nil, “baseRole”=>nil, “monDtlDef_id”=>nil}>
#“ESCHECHTZ”, “sunToSatRoles”=>"", “currentRole”=>“P”, “group_id”=>nil,
“id”=>“1”, “loggedIn”=>“0”, “baseRole”=>“S”, “monDtlDef_id”=>nil}>
.
When I change
to
my output is
@attributes
@attributes
@attributes
Further inspection shows @attributes is an array of length 1. My
question is, given that the inspect method shows what I need, how do I
reference the list of columns? (Once there, I can reference
i.currentRole to list values, etc.)
Appreciate any pointers –
Ed Schechter