Permalink
Browse files

Add CSS class to select fragments for time elements

Appropriate CSS classes help provide hooks for styling and JS
e.g. instead of having to refer to the day, month, year selects
by their nth-child ordering, we can do .input_day and .input_month
  • Loading branch information...
1 parent f68d4c8 commit 5d5b6dcb607e9cd519aad28f592e4edf70f697f7 Phu Ly committed May 31, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/formtastic/inputs/base/timeish.rb
@@ -157,7 +157,7 @@ def value
def fragment_input_html(fragment)
opts = input_options.merge(:prefix => fragment_prefix, :field_name => fragment_name(fragment), :default => value, :include_blank => include_blank?)
- template.send(:"select_#{fragment}", value, opts, input_html_options.merge(:id => fragment_id(fragment)))
+ template.send(:"select_#{fragment}", value, opts, input_html_options.merge(:id => fragment_id(fragment), :class => "input_#{fragment_label(fragment).downcase}" ))
end
def fragment_prefix

0 comments on commit 5d5b6dc

Please sign in to comment.