* 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",

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*

You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/oJl-6ia_jSoJ.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
postedApr 19, '12 at 6:13p
activeApr 19, '12 at 6:13p

1 user in discussion

Amvis: 1 post



site design / logo © 2022 Grokbase