CSS attributes for date_select

How can I specify a CSS attribute for date_select?

If I write for example:

<%= date_select ‘study’, ‘data_on’, :order => [:day, :month, :year],
:start_year => 1940, :end_year => Time.now.year, :class => “mandatory”
%>

and then look at the generated HTML, I find no evidence of the CSS
attribute.

Any help appreciated.

On Jul 10, 2007, at 11:09 , Roberto Gattinoni wrote:

How can I specify a CSS attribute for date_select?

I don’t believe date_select provides for HTML options. What would it
mean? Apply the same class=“mandatory” to each of the three generated
s? I’d put the class attribute in the parent element of the
date_select.

Michael G.
grzm seespotcode net

Hi Roberto,

Looks like date_select doesn’t take any html_options as a parameter
except in edge rails.

http://dev.rubyonrails.org/ticket/6000
<http://api.rubyonrails.org/classes/ActionView/Helpers/
DateHelper.html#M000577>

Brad.

On Jul 10, 12:09 pm, Roberto Gattinoni <rails-mailing-l…@andreas-

Michael G. wrote:

On Jul 10, 2007, at 11:09 , Roberto Gattinoni wrote:

How can I specify a CSS attribute for date_select?

I don’t believe date_select provides for HTML options. What would it
mean? Apply the same class=“mandatory” to each of the three generated
s? I’d put the class attribute in the parent element of the
date_select.

Michael G.
grzm seespotcode net

Not the same thing: try to apply a background-color attribute to the
parent element of a SELECT.

Roberto Gattinoni.

On Jul 11, 2007, at 0:57 , Roberto Gattinoni wrote:

Michael G.
grzm seespotcode net

Not the same thing: try to apply a background-color attribute to the
parent element of a SELECT.

You mean you want to set the background-color of the select rather
then the select’s parent element, correct?

HTML fragment:

bar baz

CSS:
p.mandatory select { background-color: red }

Michael G.
grzm seespotcode net

Michael G. wrote:

On Jul 11, 2007, at 0:57 , Roberto Gattinoni wrote:

Michael G.
grzm seespotcode net

Not the same thing: try to apply a background-color attribute to the
parent element of a SELECT.

You mean you want to set the background-color of the select rather
then the select’s parent element, correct?

HTML fragment:

bar baz

CSS:
p.mandatory select { background-color: red }

Michael G.
grzm seespotcode net

… sounds good (better a cause

is a block-level element and
forces a new-line).

Thanks for the suggestion.
Roberto Gattinoni.

On Jul 10, 2007, at 13:18 , Brad C. wrote:

Looks like date_select doesn’t take any html_options as a parameter
except in edge rails.

http://dev.rubyonrails.org/ticket/6000

The ticket is still open: this hasn’t been applied and therefore
isn’t in Edge.

Michael G.
grzm seespotcode net

On Jul 11, 2007, at 9:16 , Roberto Gattinoni wrote:

… sounds good (better a cause

is a block-level element
and
forces a new-line).

p.mandatory { display:inline }

Michael G.
grzm seespotcode net