Module: MenuHelper
- Defined in:
- app/helpers/menu_helper.rb
Instance Method Summary collapse
-
#build_menu(menu) ⇒ Object
build menu to site.
- #build_menu_admin ⇒ Object
- #build_menu_items(menu) ⇒ Object
- #build_menu_maintence ⇒ Object
Instance Method Details
#build_menu(menu) ⇒ Object
build menu to site
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/helpers/menu_helper.rb', line 8 def () raw %Q{ <li id="fat-menu" class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> #{t([:title]+".link")} <b class="caret"></b> </a> <ul class="dropdown-menu"> #{()} </ul> </li> } end |
#build_menu_admin ⇒ Object
51 52 53 |
# File 'app/helpers/menu_helper.rb', line 51 def () (GUARACRM::Menus::ADMINISTRATION) end |
#build_menu_items(menu) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'app/helpers/menu_helper.rb', line 21 def () returns = "" [:items].each do |item| rails_model = item.to_s.titlecase.gsub(' ','').singularize.to_sym if can? :read, rails_model if (item.is_a? Array) item_title = item[0] path = eval item[1] else item_title = item = [] << [:namespace] if ![:namespace].empty? << item << "path" path = eval(.join('_')+"()") end returns += %Q{ <li>#{ link_to t(item_title.to_s+".title"), path }</li> } end end returns end |
#build_menu_maintence ⇒ Object
47 48 49 |
# File 'app/helpers/menu_helper.rb', line 47 def () (GUARACRM::Menus::MAINTENCE) end |