# Ruby select helpers

**URL:** <https://www.ruby-forum.com/t/ruby-select-helpers/93209>\
**Category:** Rails\
**Created:** [April 29, 2007, 9:42am UTC](https://www.ruby-forum.com/t/ruby-select-helpers/93209 "2007-04-29T09:42:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pingu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a9a28c/32.png) [@pingu](https://www.ruby-forum.com/u/pingu)\
**Post date:** [April 29, 2007, 9:42am UTC](https://www.ruby-forum.com/t/ruby-select-helpers/93209/1 "2007-04-29T09:42:39Z")

</div>

Hi

Can anyone tell me when i should be using the different select helpers

select(object, method, collection, options = {}, html\_options = {})

select\_tag(name, option\_tags = nil, options = {})

collection\_select(object, method, collection, value\_method, text\_method,  
options = {}, html\_options = {})

Is that all of them? I understand the advantages of using  
collection\_select over the others, as it allows me to pass in a hash,  
but other than that, the whole thing confuses me.

Thanks

---

<div class="post-metadata">

**Author:** ![pingu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a9a28c/32.png) [@pingu](https://www.ruby-forum.com/u/pingu)\
**Post date:** [April 29, 2007, 10:56am UTC](https://www.ruby-forum.com/t/ruby-select-helpers/93209/2 "2007-04-29T10:56:32Z")

</div>

Pingu P. wrote:

> Can anyone tell me when i should be using the different select helpers
> 
> select(object, method, collection, options = {}, html\_options = {})
> 
> select\_tag(name, option\_tags = nil, options = {})

Use the first when @object is an instance of an Active Record model.  
It automatically sets a suitable name attribute for posted parameters,  
and also automatically selects the current value of @object.method.

Use the second for full custom control over the name and selected value.

–  
We develop, watch us RoR, in numbers too big to ignore.
