aboutsummaryrefslogtreecommitdiffstats
path: root/actionview
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2016-04-20 04:02:50 -0300
committerRafael França <rafaelmfranca@gmail.com>2016-04-20 04:02:50 -0300
commit597fa0b42f90bbef6a8c7628d4e08fb132fba887 (patch)
treea2f1230fd97c7d7dff23ec57e55de4f097714910 /actionview
parentd06f0a6e46ca2fd2508ec92ecf52c5e3e0c93b6e (diff)
parent01a7a01bf111a985788c7167535026c49cf1180a (diff)
downloadrails-597fa0b42f90bbef6a8c7628d4e08fb132fba887.tar.gz
rails-597fa0b42f90bbef6a8c7628d4e08fb132fba887.tar.bz2
rails-597fa0b42f90bbef6a8c7628d4e08fb132fba887.zip
Merge pull request #24642 from prathamesh-sonpatki/fix-with-css-classes-example
Fix example for css_class_attribute and fix indentation
Diffstat (limited to 'actionview')
-rw-r--r--actionview/lib/action_view/helpers/date_helper.rb12
1 files changed, 6 insertions, 6 deletions
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