mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2025-04-20 07:11:33 +02:00
Add pagination via kaminari
This commit is contained in:
parent
f71c083722
commit
40eeac2021
13 changed files with 57 additions and 5 deletions
|
@ -2,10 +2,9 @@ class SearchController < ApplicationController
|
|||
def index
|
||||
@show_search_result = params[:q].present?
|
||||
@papers = if @show_search_result
|
||||
# TODO: Add pagination
|
||||
Paper.search(params[:q]).records
|
||||
Paper.search(params[:q]).page(params[:page]).results
|
||||
else
|
||||
Paper.last(30)
|
||||
Paper.order(published_at: :desc).page(params[:page])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue