Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Applying CSS class on time_zone_select

Is it possible to provide a CSS class for the time_zone_select FormHelper in Rails 3. I currently have something like

f.time_zone_select :time_zone 

Have tried options like -

f.time_zone_select :time_zone, nil, :class => 'classname'

But that does not work

like image 492
Sam Wilder Avatar asked Nov 08 '11 09:11

Sam Wilder


2 Answers

Try the following code:

f.time_zone_select :time_zone, nil, {}, {:class => 'classname'}
like image 51
Dipil Avatar answered Oct 06 '22 00:10

Dipil


Just in case anyone is wondering where to add the :default =>

f.time_zone_select :time_zone, nil, {:default => default_timezone}, {:class => 'classname'}
like image 38
Kevin Dewalt Avatar answered Oct 05 '22 23:10

Kevin Dewalt