Class: ExpressAdmin::ModuleSidebar

Inherits:
ExpressTemplates::Components::Base
  • Object
show all
Defined in:
app/components/express_admin/module_sidebar.rb

Overview

renders a sidebar partial if one is available otherwise uses menu.yml

Instance Method Summary collapse

Instance Method Details

#build(*args, &block) ⇒ Object



14
15
16
17
18
19
20
# File 'app/components/express_admin/module_sidebar.rb', line 14

def build(*args, &block)
  begin
    render("shared/#{helpers.current_module_path_name}/sidebar")
  rescue Exception => e
    super(*args, &block)
  end
end


22
23
24
25
26
# File 'app/components/express_admin/module_sidebar.rb', line 22

def menu_list(list)
  list.each do |item|
    menu_list_item(item)
  end
end


28
29
30
31
32
# File 'app/components/express_admin/module_sidebar.rb', line 28

def menu_list_item(item)
  li {
    link_to item.title.html_safe, helpers.instance_eval(item.path)
  }
end