From 01a7a01bf111a985788c7167535026c49cf1180a Mon Sep 17 00:00:00 2001 From: Prathamesh Sonpatki Date: Wed, 20 Apr 2016 10:22:57 +0530 Subject: Fix example for css_class_attribute and fix indentation --- actionview/lib/action_view/helpers/date_helper.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'actionview') diff --git a/actionview/lib/action_view/helpers/date_helper.rb b/actionview/lib/action_view/helpers/date_helper.rb index d83cfbb734..9042b9cffd 100644 --- a/actionview/lib/action_view/helpers/date_helper.rb +++ b/actionview/lib/action_view/helpers/date_helper.rb @@ -1007,15 +1007,15 @@ module ActionView end # Builds the css class value for the select element - # css_class_attribute(:year, 'date optional', with_css_classes: { year: 'my-year' }) + # css_class_attribute(:year, 'date optional', { year: 'my-year' }) # => "date optional my-year" def css_class_attribute(type, html_options_class, options) # :nodoc: css_class = case options - when Hash - options[type.to_sym] - else - type - end + when Hash + options[type.to_sym] + else + type + end [html_options_class, css_class].compact.join(' ') end -- cgit v1.2.3