# How to handle collection\_select

**URL:** <https://www.ruby-forum.com/t/how-to-handle-collection-select/132249>\
**Category:** Rails\
**Created:** [March 18, 2008, 10:21am UTC](https://www.ruby-forum.com/t/how-to-handle-collection-select/132249 "2008-03-18T10:21:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hemantaray](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b19c9b/32.png) [@hemantaray](https://www.ruby-forum.com/u/hemantaray)\
**Post date:** [March 18, 2008, 10:21am UTC](https://www.ruby-forum.com/t/how-to-handle-collection-select/132249/1 "2008-03-18T10:21:59Z")

</div>

i have already used ‘collection\_select’ select helper for drop down box.  
it works properly and retrieve data from database(mysql).Bt I did’t not  
select any  
particular data from database and did’t fire the quary

for drop down I use  
this syntax  
\<%= collection\_select(:practices, :id, @cfohomes, :id,  
:cfod\_suniversity, options ={:prompt =\> “-Select a University”}, :class  
=\>“practices”) %\>

here cfod\_suniversity is a attribute of my database

plz provide a simple code to insert the selected item into database
