Class: DropdownHelper::Dropdown
- Inherits:
-
Object
- Object
- DropdownHelper::Dropdown
- Includes:
- ActionView::Helpers::TagHelper
- Defined in:
- app/helpers/dropdown_helper.rb
Instance Method Summary collapse
- #divider(options = {}) ⇒ Object
- #header(text, options = {}) ⇒ Object
- #item(text, link_or_options = nil, options = {}) ⇒ Object
Instance Method Details
#divider(options = {}) ⇒ Object
36 37 38 39 40 41 42 |
# File 'app/helpers/dropdown_helper.rb', line 36 def divider(={}) classes = parse_html_classes_to_arr [:class] classes << 'divider' = .dup [:class] = classes content_tag :li, '', end |
#header(text, options = {}) ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'app/helpers/dropdown_helper.rb', line 44 def header(text, ={}) = .dup classes = parse_html_classes_to_arr [:class] classes << 'dropdown-header' [:class] = classes content_tag :li, text, end |
#item(text, link_or_options = nil, options = {}) ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'app/helpers/dropdown_helper.rb', line 25 def item(text, =nil, ={}) if .is_a? Hash , = nil, end ||= '#' content = content_tag :a, text, href: content_tag :li, content, end |