Skip to content

Instantly share code, notes, and snippets.

@camkidman
Created April 24, 2017 21:03
Show Gist options
  • Save camkidman/278c59a87b51212690363fc1278e63ec to your computer and use it in GitHub Desktop.
Save camkidman/278c59a87b51212690363fc1278e63ec to your computer and use it in GitHub Desktop.
## Your controller
def index
if search_params.present?
@cards = Card.where(search_params)
else
@cards = Card.all
end
end
private
def search_params
params.permit(:name, :set, :number, :rarity, ...)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment