# Finding out about options

**URL:** <https://www.ruby-forum.com/t/finding-out-about-options/63629>\
**Category:** Rails\
**Created:** [June 16, 2006, 8:19pm UTC](https://www.ruby-forum.com/t/finding-out-about-options/63629 "2006-06-16T20:19:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@dave](https://www.ruby-forum.com/u/dave)\
**Post date:** [June 16, 2006, 8:19pm UTC](https://www.ruby-forum.com/t/finding-out-about-options/63629/1 "2006-06-16T20:19:18Z")

</div>

I’ve been to the RoR api docs trying to find out  
about options for various methods (mostly for  
select helper methods), yet I find no listing of  
options even when the method described says  
that it takes options. How  
can I find out what are valid  
options say for a date\_select tag?

Thanks,

Dave

---

<div class="post-metadata">

**Author:** ![dave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@dave](https://www.ruby-forum.com/u/dave)\
**Post date:** [June 16, 2006, 8:44pm UTC](https://www.ruby-forum.com/t/finding-out-about-options/63629/2 "2006-06-16T20:44:32Z")

</div>

On 6/16/06, Dave [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’ve been to the RoR api docs trying to find out  
> about options for various methods (mostly for  
> select helper methods), yet I find no listing of  
> options even when the method described says  
> that it takes options. How  
> can I find out what are valid  
> options say for a date\_select tag?

Dave,

In many places it’s not obvious, but in the example that you gave  
(date\_select), a careful reading of the documentation provides the  
answer.

It's possible to tailor the selects through the options hash, which accepts all the keys that each of the individual select builders do (like :use\_month\_numbers for select\_month) as well as a range of discard options. The discard options are :discard\_year, :discard\_month and :discard\_day.

Also, notice at the top of the page the following:

All of the select-type methods share a number of common options that are as follows:

```
* :prefix - overwrites the default prefix of "date" used for the

```

select names. So specifying “birthday” would give birthday[month]  
instead of date[month] if passed to the select\_month method.  
\* :include\_blank - set to true if it should be possible to set an  
empty date.  
\* :discard\_type - set to true if you want to discard the type part  
of the select name. If set to true, the select\_month method would use  
simply “date” (which can be overwritten using :prefix) instead of  
“date[month]”.

Hope this helps.

Todd

---

<div class="post-metadata">

**Author:** ![dave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@dave](https://www.ruby-forum.com/u/dave)\
**Post date:** [June 16, 2006, 9:15pm UTC](https://www.ruby-forum.com/t/finding-out-about-options/63629/3 "2006-06-16T21:15:27Z")

</div>

Todd B. \<talanb@…\> writes:

> Hope this helps.
> 
> Todd

Yep, Todd, it did. I must have been blind when I  
went to that page. I think I was looking for something  
else at the time, and the options issue raised it’s  
ugly head later. Sorry for being asleep. I’ll learn to read  
better next time. 🙂

Thanks for your help,

Dave

---

<div class="post-metadata">

**Author:** ![dave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@dave](https://www.ruby-forum.com/u/dave)\
**Post date:** [June 16, 2006, 10:22pm UTC](https://www.ruby-forum.com/t/finding-out-about-options/63629/4 "2006-06-16T22:22:51Z")

</div>

I find that looking at the source sometimes helps when the docs do let  
me down though. That’s a bit hit-and-miss too though, because  
sometimes I have to look through quite a lot of source to work stuff  
out.  
-Nathan
