Module: Maquina::NavbarMenuHelper

Defined in:
app/helpers/maquina/navbar_menu_helper.rb

Instance Method Summary collapse

Instance Method Details

#active_menu_option?(path) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'app/helpers/maquina/navbar_menu_helper.rb', line 13

def active_menu_option?(path)
  request.path == path
end


5
6
7
8
9
10
11
# File 'app/helpers/maquina/navbar_menu_helper.rb', line 5

def menu_options
  options = {}
  options[:plans] = maquina.plans_path if Maquina::Current.signed_in? && allowed_to?(:plans?, with: Maquina::NavigationPolicy)
  options[:users] = maquina.users_path if Maquina::Current.signed_in? && allowed_to?(:users?, with: Maquina::NavigationPolicy)

  options
end

#profile_menu_optionsObject



17
18
19
20
21
22
23
24
25
26
27
# File 'app/helpers/maquina/navbar_menu_helper.rb', line 17

def profile_menu_options
  if Maquina::Current.signed_in?
    {
      signout: {method: :delete, path: maquina.sessions_path}
    }
  else
    {
      signin: maquina.new_sessions_path
    }
  end
end