7 lines
409 B
Plaintext
7 lines
409 B
Plaintext
- namespace = which_menu == 'admins_menu' ? 'admin_' : ''
|
|
%ul
|
|
- (collection = t which_menu).each do |base, title|
|
|
- if can? :index, base.to_s.classify.constantize
|
|
%li= link_to title, send(:"#{namespace}#{base}_path"), class: top_menu_class(base)
|
|
- if current_user.try(:admin?) and which_menu == 'top_menu'
|
|
%li= link_to t('admins_menu_header'), admin_root_path, class: top_menu_class('admin') |