0
사용자 검색 기능이 하나 뿐이므로 현재 사용자 테이블에 페이지 매김 기능이 있습니다.다음 텍스트에 페이지 매김을 추가하십시오.
하지만 이제는 게임 테이블에 페이지 매김을 추가하고 싶지만 게임에 5 가지 검색 기능이 있으므로 구현 방법을 모르겠습니다. 다음 컨트롤러 메서드에 페이지 매김을 추가하는 방법에 대해 궁금합니다.
def index
@games = Game.gamsearch(params[:gamsearch])
@games = Game.consearch(params[:consearch]) if params[:consearch].present?
@games = Game.gensearch(params[:gensearch]) if params[:gensearch].present?
@games = Game.where("game_name LIKE ?", "#{params[:game_name]}%") if params[:game_name].present?
@games = Game.where("console = ?", params[:console]) if params[:console].present?
end
내가 범위를 사용하여 시도를하지만, 이미 정의되어 있음에도 불구하고 정의되지 않은 메서드 매김을 유지합니다. – user1222136