Skip to content

Instantly share code, notes, and snippets.

# Title
# Input Requirements:
# title_search as a string
# title_search_type as 'contains' or 'starts_with', simple search would probably use starts_with
# Database Requirements
# Game table has field 'title' for game's name
title_search_type = params[:title_search_type] if params[:title_search_type].present?
title_search = params[:title_search].strip if params[:title_search].present
if title_search.length == 0
title_search_type = nil