app/controllers/recommender/entries_controller.rb in muck-raker-0.1.9 vs app/controllers/recommender/entries_controller.rb in muck-raker-0.1.10
- old
+ new
@@ -68,16 +68,16 @@
protected
def _search operator = :or
@page = (params[:page] || 0).to_i
@per_page = (params[:per_page] || 10).to_i
- @offset = (@page-1)*@per_page
+ @offset = @page*@per_page
if !@search.nil?
@term_list = URI.escape(@search)
results = Entry.search(@search, I18n.locale.to_s, @per_page, @offset, operator)
@hit_count = results.total
@results = results.results
- @paginated_results = @results.paginate(:page => @page, :per_page => @per_page, :total_entries => @hit_count)
+ @paginated_results = @results.paginate(:page => @page+1, :per_page => @per_page, :total_entries => @hit_count)
end
end
end