My controller passes this array to the view:
@ipd = Ipdw.connection.select_all("select * from [My Preferences]") This is my view code:
<h1>Hello, Rails</h1> <body> <% @ipd.each do |ip| %> <p><%= ip %></p> <% end %> </body> This is displayed in the browser:
{"Pref ID"=>1, "Source ID"=>1, "Username"=>"RS2559", "Field Name"=>"CATEGORY", "String Value"=>"IP Placemat Deliverables", "Integer Value"=>nil, "Decimal Value"=>nil, "Created Dt Tm"=>2009-08-10 03:01:36 UTC, "Update Dt Tm"=>2009-12-14 16:04:01 UTC} {"Pref ID"=>2, "Source ID"=>1, "Username"=>"RS2559", "Field Name"=>"TYPE", "String Value"=>nil, "Integer Value"=>nil, "Decimal Value"=>nil, "Created Dt Tm"=>2009-08-10 03:01:40 UTC, "Update Dt Tm"=>2009-12-14 16:04:01 UTC} ... I want to show the "Username" and "Field Name" in a table. How can I loop through the array to show only these columns in a readable matter?