Applying CSS class on time_zone_select
-
24-02-2021 - |
Question
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
Solution
Try the following code:
f.time_zone_select :time_zone, nil, {}, {:class => 'classname'}
OTHER TIPS
Just in case anyone is wondering where to add the :default =>
f.time_zone_select :time_zone, nil, {:default => default_timezone}, {:class => 'classname'}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow