2012-02-08 14:01:00 +00:00
|
|
|
%ul
|
2012-03-19 17:32:02 +00:00
|
|
|
- (collection = t which_menu).each do |base, title|
|
2012-02-08 14:01:00 +00:00
|
|
|
- if can? :index, base.to_s.classify.constantize
|
2012-03-20 23:11:58 +00:00
|
|
|
%li= link_to title, send(:"#{base}_path"), :class => [].tap{|c| c << 'active' if params[:controller] == base.to_s}.join(' ')
|
2012-03-19 17:32:02 +00:00
|
|
|
- if current_user.admin? && which_menu == 'top_menu'
|
|
|
|
%li= link_to 'Admin', users_path, :class => t('admins_menu').has_key?(params[:controller].to_sym) ? 'active' : ''
|