aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers
diff options
context:
space:
mode:
authorPavel Nikitin <daddybutcher@gmail.com>2012-10-17 12:33:17 +0300
committerPavel Nikitin <daddybutcher@gmail.com>2012-10-18 19:21:20 +0300
commita48ef9b879a29cb54e01ad295224e056fb0966e1 (patch)
tree3b65f827bfd932f456622972744ccbc7d2e98932 /actionpack/lib/action_view/helpers
parentc432c74cd34d4230bfda6fa008f2af9dbc33e523 (diff)
downloadrails-a48ef9b879a29cb54e01ad295224e056fb0966e1.tar.gz
rails-a48ef9b879a29cb54e01ad295224e056fb0966e1.tar.bz2
rails-a48ef9b879a29cb54e01ad295224e056fb0966e1.zip
Extend date_select helper functionality.
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r--actionpack/lib/action_view/helpers/date_helper.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb
index 387dfeab17..5464437e42 100644
--- a/actionpack/lib/action_view/helpers/date_helper.rb
+++ b/actionpack/lib/action_view/helpers/date_helper.rb
@@ -196,6 +196,8 @@ module ActionView
# for <tt>:year</tt>, <tt>:month</tt>, <tt>:day</tt>, <tt>:hour</tt>, <tt>:minute</tt> and <tt>:second</tt>.
# Setting this option prepends a select option with a generic prompt (Day, Month, Year, Hour, Minute, Seconds)
# or the given prompt string.
+ # * <tt>:with_css_classes</tt> - Set to true if you want assign different styles for 'select' tags. This option
+ # automatically set classes 'year', 'month', 'day', 'hour', 'minute' and 'second' for your 'select' tags.
#
# If anything is passed in the +html_options+ hash it will be applied to every select tag in the set.
#
@@ -937,6 +939,7 @@ module ActionView
:name => input_name_from_type(type)
}.merge!(@html_options)
select_options[:disabled] = 'disabled' if @options[:disabled]
+ select_options[:class] = type if @options[:with_css_classes]
select_html = "\n"
select_html << content_tag(:option, '', :value => '') + "\n" if @options[:include_blank]