# Rails Select Helper

**URL:** <https://www.ruby-forum.com/t/rails-select-helper/171422>\
**Category:** Rails\
**Created:** [July 2, 2009, 6:54am UTC](https://www.ruby-forum.com/t/rails-select-helper/171422 "2009-07-02T06:54:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![newb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/2acd7d/32.png) [@newb](https://www.ruby-forum.com/u/newb)\
**Post date:** [July 2, 2009, 6:54am UTC](https://www.ruby-forum.com/t/rails-select-helper/171422/1 "2009-07-02T06:54:48Z")

</div>

Dear All,

I m using the below select helper for my select helper which works fine.

\<%=privilege. select :AC,Role.find(:all,:conditions =\> {:role\_type =\>  
“AC”}).collect {|c| [c.role\_name, c.id] },{},{:class =\> “txtbox”} %\>

Its generates the below html…

Trainees Test Group Role

Is it possible to add title for the select options…  
i need like below…is it possible to get this via rails select  
helper…

Test Group Role

Kindly give your suggestions and helps.  
Thanks

---

<div class="post-metadata">

**Author:** ![newb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/2acd7d/32.png) [@newb](https://www.ruby-forum.com/u/newb)\
**Post date:** [July 2, 2009, 3:08pm UTC](https://www.ruby-forum.com/t/rails-select-helper/171422/2 "2009-07-02T15:08:42Z")

</div>

You want to lookup collection\_select in the Rails API. It is a whole  
lot easier for what you are trying to do.  
Bharat
