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

--
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 @
categoriesrubyonrails
postedApr 19, '12 at 6:13p
activeApr 19, '12 at 6:13p
posts1
users1
websiterubyonrails.org
irc#RubyOnRails

1 user in discussion

Amvis: 1 post

People

Translate

site design / logo © 2022 Grokbase