Reputation: 1229
I realise paginating with Kaminari is supposed to be simple, but I seem to be missing something...
My guidelines_controller.rb index action is
def index
if params[:search].present?
@search = Sunspot.search(Guideline) do
fulltext params[:search]
end
@guidelines = @search.results
else
@guidelines = Guideline.order(:title).page(params[:page])
end
and I've added to views/guidelines/index.html.erb
<%= paginate @guidelines %>
But nothing is showing on my index page (Kaminari is bundled successfully). What am I missing?
Upvotes: 3
Views: 752
Reputation: 1229
As per Sergey Kishenin - I didn't have enough guidelines on my local database for kaminari. Adding per(1) scope made all the difference.
Upvotes: 1