# Date\_select css options

**URL:** <https://www.ruby-forum.com/t/date-select-css-options/106749>\
**Category:** Rails\
**Created:** [June 13, 2007, 8:20pm UTC](https://www.ruby-forum.com/t/date-select-css-options/106749 "2007-06-13T20:20:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gabordemeter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/9de053/32.png) [@gabordemeter](https://www.ruby-forum.com/u/gabordemeter)\
**Post date:** [June 13, 2007, 8:20pm UTC](https://www.ruby-forum.com/t/date-select-css-options/106749/1 "2007-06-13T20:20:06Z")

</div>

Just looked at the Date helper in the rails API and noticed that none  
of the functions there (i.e. date\_select) allow me to specify html  
options (i.e. class) for the generated selects.

I was wondering how do other group members css format date select  
dropdowns?

Best,

Gabor

---

<div class="post-metadata">

**Author:** ![gabordemeter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/9de053/32.png) [@gabordemeter](https://www.ruby-forum.com/u/gabordemeter)\
**Post date:** [June 13, 2007, 8:36pm UTC](https://www.ruby-forum.com/t/date-select-css-options/106749/2 "2007-06-13T20:36:08Z")

</div>

On 6/13/07, gabordemeter [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Just looked at the Date helper in the rails API and noticed that none  
> of the functions there (i.e. date\_select) allow me to specify html  
> options (i.e. class) for the generated selects.
> 
> I was wondering how do other group members css format date select  
> dropdowns?

Use a wrapper element and then style using CSS selectors:

content\_tag(:div, date\_select(:widget, :date), :class =\>  
‘date\_select’)

CSS:

.date\_select select { … }

---

<div class="post-metadata">

**Author:** ![gabordemeter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/9de053/32.png) [@gabordemeter](https://www.ruby-forum.com/u/gabordemeter)\
**Post date:** [June 14, 2007, 12:22am UTC](https://www.ruby-forum.com/t/date-select-css-options/106749/3 "2007-06-14T00:22:49Z")

</div>

Thanks Bob. I thought of that myself but wanted to double check that  
there’s no other more direct way to do it.

---

<div class="post-metadata">

**Author:** ![gabordemeter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/9de053/32.png) [@gabordemeter](https://www.ruby-forum.com/u/gabordemeter)\
**Post date:** [June 14, 2007, 3:04am UTC](https://www.ruby-forum.com/t/date-select-css-options/106749/4 "2007-06-14T03:04:07Z")

</div>

On 6/13/07, gabordemeter [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thanks Bob. I thought of that myself but wanted to double check that  
> there’s no other more direct way to do it.

It looks like you’ll be able to set html options in the future:

[http://dev.rubyonrails.org/ticket/6000](http://dev.rubyonrails.org/ticket/6000)
