rosa-build/app/views/layouts/menu/_top.html.haml

7 lines
400 B
Plaintext

%ul
- (collection = t which_menu).each do |base, title|
- if can? :index, base.to_s.classify.constantize
%li= link_to title, send(:"#{base}_path"), :class => controller_name == base.to_s ? 'active' : ''
- if current_user.admin? && which_menu == 'top_menu'
%li= link_to t('admins_menu_header'), users_path, :class => t('admins_menu').has_key?(controller_name.to_sym) ? 'active' : ''