Created
March 28, 2019 09:59
-
-
Save MaryKuz/762a2b519348beea3029c7b5254fa423 to your computer and use it in GitHub Desktop.
Collect the #collection method
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
class Api::ProductsController < ApplicationController | |
private | |
def collection | |
@products ||= Product.search_by(params) | |
end | |
.... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment