Sunday, April 15, 2012

[Rails] select in rails 2

Hi all,

Im facing problem with select in rails.

I have providers and categories..

they have a joining table providers_categories where i store both
provider_id and category_id.

In new page I have the multiple select for categories while creating a
provider like this.. Im using haml

= select(:provider, :provider_category_id,
ProviderCategory.all.collect{|p| [p.name, p.id,]}, {},
{:multiple=>true})

But while editing, The select tag should display all the selected
categories to be selected default..

I dont know how to do this..


Please help me in this..


Regards,

P.Angel

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
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.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate