Skip to content

Commit

Permalink
[#269] Add pagination to search results
Browse files Browse the repository at this point in the history
  • Loading branch information
seancdavis committed Jun 24, 2018
1 parent fe0fba3 commit d09ceb6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/controllers/views_controller.rb
Expand Up @@ -3,6 +3,7 @@ class ViewsController < ApplicationController
def show
not_found if current_view.blank?
@elements = SearchElementsService.call(property: current_property, q: current_view.q)
@elements = Kaminari.paginate_array(@elements).page(params[:page] || 1).per(20)
render 'elements/search'
end

Expand Down
1 change: 1 addition & 0 deletions app/views/elements/search.html.erb
Expand Up @@ -38,6 +38,7 @@
</tbody>
</table>
</div>
<%= paginate @elements %>
<% else %>
<%= render 'empty' %>
<% end %>
Expand Down

0 comments on commit d09ceb6

Please sign in to comment.