Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix example for css_class_attribute and fix indentation #24642

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions actionview/lib/action_view/helpers/date_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1007,15 +1007,15 @@ def build_select(type, select_options_as_html)
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
Expand Down