# Select tag with unique values from db

**URL:** <https://www.ruby-forum.com/t/select-tag-with-unique-values-from-db/188008>\
**Category:** Rails\
**Created:** [May 4, 2010, 2:31am UTC](https://www.ruby-forum.com/t/select-tag-with-unique-values-from-db/188008 "2010-05-04T02:31:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![krismartin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/7ab992/32.png) [@krismartin](https://www.ruby-forum.com/u/krismartin)\
**Post date:** [May 4, 2010, 2:31am UTC](https://www.ruby-forum.com/t/select-tag-with-unique-values-from-db/188008/1 "2010-05-04T02:31:51Z")

</div>

Hi. I just want to ask some help regarding my simple project. i’m a  
rails newbie and right now, quite stuck with this.

I have this select\_tag in my rhtml…

\<%= select\_tag ‘search[outcome]’, options\_for\_select(["", “qp1”, “qp2”,  
“Not Processed”], (params[:search] && params[:search][:outcome])) %\>

it works fine. But now, I want to get the distinct values of my  
options\_for\_select from my database table, green.

how can i do this in my controller and view? thanks.
