Created
April 24, 2017 21:03
-
-
Save camkidman/278c59a87b51212690363fc1278e63ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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