app/controllers/services_controller.rb
def groups
    @selected_group = params[:selected_group]
    if params[:service][:id] == "0"
      @groups = Group.joins(:employees).uniq.order(:name)
    else 
      @service = Service.find(params[:service][:id])
      @groups = @service.groups(@year)
    end
    render :layout => false
  end
# Populates the group dropdown list on the "pages/home" page based on the service selected
Populates the group dropdown list on the "pages/home" page based on the service selected
Populates the group dropdown list on the " pages / home " page based on the service selected
def groups
    @selected_group = params[:selected_group]
    if params[:service][:id] == "0"
      @groups = Group.joins(:employees).uniq.order(:name)
    else 
      @service = Service.find(params[:service][:id])
      @groups = @service.groups(@year)
    end
    render :layout => false
  end
def groups @selected_group = params [ :selected_group ] if params [ :service ] [ :id ] == "0" @groups = Group . joins ( :employees ) . uniq . order ( :name ) else @service = Service . find ( params [ :service ] [ :id ] ) @groups = @service . groups ( @year ) end render :layout => false end
Populates the group dropdown list on the "pages/home" page based on the service selected
Populates the group dropdown list on the " pages / home " page based on the service selected