Class: Fluffery::Utils::Internal
- Inherits:
-
Object
- Object
- Fluffery::Utils::Internal
- Defined in:
- lib/fluffery/utils/internal.rb
Class Method Summary collapse
-
.merge_html_classes(options, classes) ⇒ Object
Merge any new classes with existing html classes.
Class Method Details
.merge_html_classes(options, classes) ⇒ Object
Merge any new classes with existing html classes
8 9 10 11 12 13 14 |
# File 'lib/fluffery/utils/internal.rb', line 8 def self.merge_html_classes(, classes) classes = [classes].flatten .stringify_keys! return .merge!('class' => classes.join(' ')) unless .has_key?('class') old_classes = ['class'].split(' ') .merge!('class' => [classes, old_classes].flatten.join(' ')) end |