* 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.