mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2025-07-14 16:31:33 +02:00
10 lines
287 B
Ruby
10 lines
287 B
Ruby
class SearchController < ApplicationController
|
|
def index
|
|
@show_search_result = params[:q].present?
|
|
@papers = if @show_search_result
|
|
Paper.search(params[:q]).page(params[:page]).results
|
|
else
|
|
Paper.order(published_at: :desc).page(params[:page])
|
|
end
|
|
end
|
|
end
|