# Collection\_select

**URL:** <https://www.ruby-forum.com/t/collection-select/132188>\
**Category:** Rails\
**Created:** [March 17, 2008, 7:27pm UTC](https://www.ruby-forum.com/t/collection-select/132188 "2008-03-17T19:27:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![subhadip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3d9bf3/32.png) [@subhadip](https://www.ruby-forum.com/u/subhadip)\
**Post date:** [March 17, 2008, 7:27pm UTC](https://www.ruby-forum.com/t/collection-select/132188/1 "2008-03-17T19:27:32Z")

</div>

i write the collection code.  
\<%= collection\_select(:info, :id, @infos, :id, :user\_id, options  
={:prompt =\> “-Select a payment”}, :class =\>“info”) %\>  
which take user\_id from database and show it properly…now i will want  
to see it,  
in controller i wrote:  
@infos= params[:info][:id]  
but this will not work…error ic nil value.  
what is the write code,that will help me…please povide  
so taht when i choose one value from drop down.it will show the  
correspoding record.
