mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2025-04-20 07:11:33 +02:00
Show last 30 papers on homepage
This commit is contained in:
parent
973af9f0d9
commit
f71c083722
3 changed files with 19 additions and 16 deletions
|
@ -1,8 +1,11 @@
|
|||
class SearchController < ApplicationController
|
||||
def index
|
||||
@result = if params[:q].present?
|
||||
@show_search_result = params[:q].present?
|
||||
@papers = if @show_search_result
|
||||
# TODO: Add pagination
|
||||
Paper.search(params[:q]).records
|
||||
else
|
||||
Paper.last(30)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue