Collection_select issues with rails

  • data = ActiveSupport::JSON.decode(response.body)*
    
  •  @catg = data["cat"]*
    

i have to populate the dropdown with* id* and name from @catg, when i
display this @catg i got like this
*
*
[{“created_at”=>“2012-03-31T05:50:27Z”, “id”=>1, “name”=>“None”,
“updated_at”=>“2012-03-31T05:50:27Z”}]

so how to get this into dropdown, and also i tried like this, actually i
didn’t understand the first two fields of collection_select, but here
just
i guess that.

<%= form_for(@biz) do |f| %>

<%= collection_select :post,:categories, @catg, :id, :name %>

<% end %>

Got the error
*

undefined method `name’ for #Hash:0xb27db74

Thank you
vishnu