app/controllers/groups_controller.rb
# Filters the services displayed on the index page based on paramaters provided
Filters the services displayed on the index page based on paramaters provided
Filters the services displayed on the index page based on paramaters provided
def filter_groups(search)
      return Group.where(true) if search.blank?
      @name = search[:name]
      @search_array = ["true"]
      @search_array << "groups.name LIKE '%#{@name}%'" unless @name.blank? 
      @search_string = @search_array.join(" AND ")
      @groups = Group.where(@search_string)
      return @groups
    end
def filter_groups ( search ) return Group . where ( true ) if search . blank? @name = search [ :name ] @search_array = [ "true" ] @search_array << "groups.name LIKE '%#{@name}%'" unless @name . blank? @search_string = @search_array . join ( " AND " ) @groups = Group . where ( @search_string ) return @groups end
Filters the services displayed on the index page based on paramaters provided
Filters the services displayed on the index page based on paramaters provided
search