Class: UserTemplates::MenuController

Inherits:
Volt::ModelController
  • Object
show all
Defined in:
app/user_templates/controllers/menu_controller.rb

Instance Method Summary collapse

Instance Method Details

#is_active?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'app/user_templates/controllers/menu_controller.rb', line 14

def is_active?
  url.path.split('/')[1] == 'login'
end

#show_nameObject



3
4
5
6
7
8
9
10
11
12
# File 'app/user_templates/controllers/menu_controller.rb', line 3

def show_name
  Volt.current_user.then do |user|
    # Make sure there is a user
    if user
      user._name || user. || user._username
    else
      ''
    end
  end
end