No CSS styles for date_select, datetime_select

Hi all.

This question has been asked before but has not been answered, so I’ll
try once again:

Adding :class => “some_css_class” to the form.date_select or
form.datetime_select helpers doesn’t do anything; the resulting HTML has
no class= attribute in the tag. Is this a bug in date_helper.rb
or am I doing something wrong?

Thanks!

/fb

Adam B. wrote:

Adding :class => “some_css_class” to the form.date_select or
form.datetime_select helpers doesn’t do anything; the resulting HTML has
no class= attribute in the tag. Is this a bug in date_helper.rb
or am I doing something wrong?

When an HTML tag doesn’t work I always try :html => { :some => ‘tag’ }.
As
far as I can tell most tag builders support that.


Phlip
http://www.greencheese.us/ZeekLand <-- NOT a blog!!!

Phlip wrote:

When an HTML tag doesn’t work I always try :html => { :some => ‘tag’ }.

Thanks for the suggestion. Didn’t work, unfortunately.

The date selectors wrap multiple HTML elements, but it looks like any
class/html attributes are not cascading downwards to the individual tag
builders.

/afb

On Dec 10, 2006, at 1:07 PM, Adam B. wrote:

builders.

/afb

Hey Adam-

Yeah the date selectors don't allow you to pass html options, lame.

The way I have worked around this was to use a little js:

Cheers-
– Ezra Z.
– Lead Rails Evangelist
[email protected]
– Engine Y., Serious Rails Hosting
– (866) 518-YARD (9273)

You can use

<%= date_select %>

css
.something select {
your styles here
}

Adam B. wrote:

Phlip wrote:

When an HTML tag doesn’t work I always try :html => { :some => ‘tag’ }.

Thanks for the suggestion. Didn’t work, unfortunately.

The date selectors wrap multiple HTML elements, but it looks like any
class/html attributes are not cascading downwards to the individual tag
builders.

/afb

Edx E. wrote:

You can use

<%= date_select %>

Doesn’t work. SELECTs seem to be very sensitive. What I am doing now is
a variant on that, though:

<%= date_select %>

.form_element select {
font-size: 10px;
}

That works, though it’s not ideal.

Thanks for all the feedback.

/afb