app/controllers/pages_controller.rb
def load_groups_services
      @services = []
      Service.order(:name).each do |service|
        @services << service if service.employees.any?
      end
      @groups = []
      Group.order(:name).each do |group|
        @groups << group if group.employees.any?
      end
    end
# Loads all services and groups which have employees
Loads all services and groups which have employees
Loads all services and groups which have employees
def load_groups_services
      @services = []
      Service.order(:name).each do |service|
        @services << service if service.employees.any?
      end
      @groups = []
      Group.order(:name).each do |group|
        @groups << group if group.employees.any?
      end
    end
def load_groups_services @services = [ ] Service . order ( :name ) . each do | service | @services << service if service . employees . any? end @groups = [ ] Group . order ( :name ) . each do | group | @groups << group if group . employees . any? end end
Loads all services and groups which have employees
Loads all services and groups which have employees