Module: Leather::LeatherHelpers

Defined in:
lib/leather/leather_helpers.rb

Instance Method Summary collapse

Instance Method Details

#active_class(href, options) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/leather/leather_helpers.rb', line 3

def active_class(href, options)
  if (options[:nav_id].present? && current_tab?(options[:nav_id][0], options[:nav_id][1])) || current_page?(href)
    'active'
  else
    ''
  end
end


54
55
56
# File 'lib/leather/leather_helpers.rb', line 54

def dropdown_nav_item(text, href, options = {}, &block)
  render partial: 'leather/bootstrap_components/dropdown_nav_item', locals: { block: capture(&block), text: text, href: href, options: options }
end


15
16
17
# File 'lib/leather/leather_helpers.rb', line 15

def modal(id = 'modal', html_options = {}, &block)
  render partial: 'leather/bootstrap_components/modal', locals: { id: id, block: capture(&block), html_options: html_options }
end


23
24
25
# File 'lib/leather/leather_helpers.rb', line 23

def modal_body(&block)
  render partial: 'leather/bootstrap_components/modal_body', locals: { block: capture(&block) }
end


27
28
29
# File 'lib/leather/leather_helpers.rb', line 27

def modal_footer(&block)
  render partial: 'leather/bootstrap_components/modal_footer', locals: { block: capture(&block) }
end


19
20
21
# File 'lib/leather/leather_helpers.rb', line 19

def modal_header(title = '', &block)
  render partial: 'leather/bootstrap_components/modal_header', locals: { title: title }
end


11
12
13
# File 'lib/leather/leather_helpers.rb', line 11

def modal_toggle(text, id = 'modal', html_options = {})
  link_to text, "##{id}", data: { toggle: "modal" }, class: html_options[:class]
end


50
51
52
# File 'lib/leather/leather_helpers.rb', line 50

def nav_item(text, href, options = {})
  render partial: 'leather/bootstrap_components/nav_item', locals: { text: text, href: href, options: options }
end


46
47
48
# File 'lib/leather/leather_helpers.rb', line 46

def nav_list(html_options = {}, &block)
  render partial: 'leather/bootstrap_components/nav_list', locals: { block: capture(&block), html_options: html_options }
end


31
32
33
34
# File 'lib/leather/leather_helpers.rb', line 31

def navbar(title, brand_link, html_options = {}, &block)
  html_options = { class: "navbar-default" }.merge(html_options)
  render partial: 'leather/bootstrap_components/navbar', locals: { title: title, brand_link: brand_link, block: capture(&block), html_options: html_options }
end


41
42
43
44
# File 'lib/leather/leather_helpers.rb', line 41

def navbar_in_container(html_options = {}, &block)
  html_options[:container_mode] = :in
  navbar(html_options, &block)
end


36
37
38
39
# File 'lib/leather/leather_helpers.rb', line 36

def navbar_with_container(html_options = {}, &block)
  html_options[:container_mode] = :with
  navbar(html_options, &block)
end