Class: Megatron::NavigationHelper::PrimaryNav

Inherits:
Nav
  • Object
show all
Defined in:
app/helpers/megatron/navigation_helper.rb

Instance Method Summary collapse

Methods inherited from Nav

#icon_label, #item, #link_label

Methods inherited from Helper

inherited

Instance Method Details

#display(body) ⇒ Object



34
35
36
# File 'app/helpers/megatron/navigation_helper.rb', line 34

def display(body)
  content_for(:primary_nav) { body }
end


30
31
32
# File 'app/helpers/megatron/navigation_helper.rb', line 30

def nav_class
  'primary_nav'
end

#sign_out(href = '/session/destroy', options = {}) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'app/helpers/megatron/navigation_helper.rb', line 38

def sign_out(href='/session/destroy', options={})
   :div, class: 'primary_nav-top' do
    options[:data] = {
      trigger: 'dialog',
      title: 'Are you sure you want to sign out?',
      message: 'Click cancel if you want to stay',
      continue: 'Sign out',
      close: 'Cancel',
      follow: href,
    }.merge(options[:data] || {})

    options[:text] ||= 'Sign out'
    options[:icon] ||= :power
    options[:link_label] = false

    concat item(options[:text], '#', options)
  end
end