Date_select css options


#1

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


#2

On 6/13/07, gabordemeter 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 { … }


#3

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


#4

On 6/13/07, gabordemeter 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