Module: Golden::Theme::Foundation::DropdownsHelper

Defined in:
lib/golden/theme/foundation/dropdowns_helper.rb

Instance Method Summary collapse

Instance Method Details

#foundation_dropdown_button(text, options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/golden/theme/foundation/dropdowns_helper.rb', line 3

def foundation_dropdown_button text, options = {}
  text = text.html_safe
  target = options.delete :target
  options = {
    data: {
      dropdown: target
    }
  }.deep_merge options
   :button, text, options
end

#foundation_dropdown_content(options = {}, &block) ⇒ Object



36
37
38
39
40
41
42
43
44
45
# File 'lib/golden/theme/foundation/dropdowns_helper.rb', line 36

def foundation_dropdown_content options = {}, &block
  html_class = options.delete :class
  options = {
    class: "f-dropdown content #{html_class}".strip,
    data: {
      dropdown_content: true
    }
  }.deep_merge options
   :div, options, &block
end


14
15
16
17
18
19
20
21
22
23
# File 'lib/golden/theme/foundation/dropdowns_helper.rb', line 14

def foundation_dropdown_link_to text, url = '#', options = {}
  text = text.html_safe
  target = options.delete :target
  options = {
    data: {
      dropdown: target
    }
  }.deep_merge options
  link_to text, url, options
end

#foundation_dropdown_ul_tag(options = {}, &block) ⇒ Object



25
26
27
28
29
30
31
32
33
34
# File 'lib/golden/theme/foundation/dropdowns_helper.rb', line 25

def foundation_dropdown_ul_tag options = {}, &block
  html_class = options.delete :class
  options = {
    class: "f-dropdown #{html_class}".strip,
    data: {
      dropdown_content: true
    }
  }.deep_merge options
  foundation_ul_tag options, &block
end