Skip to content

Commit

Permalink
explicitly check for error state in bento results from summon
Browse files Browse the repository at this point in the history
otherwise this errors out when expecting a number in total_items
See: #80
  • Loading branch information
magibney committed Sep 30, 2020
1 parent 68ea0e4 commit 84fa596
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GIT
remote: https://github.com/magibney/bento_search
revision: af7c055b8ee0eed24c7fcf02e4fdab33b3e67bbe
revision: 3f45d1c286ae19146aa51dc7b54b5a5a6b7c3dd0
branch: search_controller_engine_params
specs:
bento_search (1.8.0)
Expand Down
6 changes: 5 additions & 1 deletion app/views/layouts/_summon_ajax_results_wrapper.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<% if results.error %>
<%= results.error[:end_user_message] || 'Error processing remote request' %>
<% else %>
<div class="view-and-filter text-right">
<%= link_to "View and filter #{number_with_delimiter(results.total_items)} #{results.total_items != 1 ? 'results' : 'result'}", summon_url(params[:q] || params[:query]) %>
</div>
Expand All @@ -13,4 +16,5 @@
<% end %>

<div class="corner left-bottom hide"></div>
<div class="corner right-bottom hide"></div>
<div class="corner right-bottom hide"></div>
<% end %>

0 comments on commit 84fa596

Please sign in to comment.