Skip to content

Commit

Permalink
enable autocomplete with configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
mejackreed committed Jul 26, 2016
1 parent eec3fbc commit 501c7fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/catalog/_search_form_no_navbar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<% end %>
<div class="input-group search-input-group">
<label for="q" class="sr-only"><%= t('blacklight.search.form.search.label') %></label>
<%= text_field_tag :q, params[:q], :placeholder => t('blacklight.search.form.search.placeholder'), :class => "search_q q form-control", :id => "q", :autofocus => should_autofocus_on_search_box? %>
<%= text_field_tag :q, params[:q], :placeholder => t('blacklight.search.form.search.placeholder'), :class => "search_q q form-control", :id => "q", :autofocus => should_autofocus_on_search_box?, data: { autocomplete_enabled: autocomplete_enabled?, autocomplete_path: blacklight.suggest_index_path } %>

<span class="input-group-btn">
<button type="submit" class="btn btn-primary search-btn" id="search">
Expand Down
4 changes: 4 additions & 0 deletions lib/generators/geoblacklight/templates/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ class CatalogController < ApplicationController
# 'positron' http://cartodb.com/basemaps/
# 'darkMatter' http://cartodb.com/basemaps/
config.basemap_provider = 'positron'

# Configuration for autocomplete suggestor
config.autocomplete_enabled = true
config.autocomplete_path = 'suggest'
end


Expand Down

0 comments on commit 501c7fd

Please sign in to comment.