Show last 30 papers on homepage

This commit is contained in:
Andreas Haller 2015-04-27 22:35:11 +02:00
parent 973af9f0d9
commit f71c083722
3 changed files with 19 additions and 16 deletions

View file

@ -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