wiki pages: fix redirects to exact matches during search.
Change wiki page search to redirect to exact matches only when using the quick search bar. Fixes searches sometimes unexpectedly redirecting when doing a regular (non-quick) search that happens to return a single result. Also remove the logic that tries to expand the search when no results are found. This will eventually be replaced with a smarter "did you mean?" search.
This commit is contained in:
@@ -164,7 +164,8 @@ module ApplicationHelper
|
||||
def quick_search_form_for(attribute, url, name, autocomplete: nil, &block)
|
||||
tag.li do
|
||||
search_form_for(url, classes: "quick-search-form one-line-form") do |f|
|
||||
f.input attribute, label: false, placeholder: "Search #{name}", input_html: { id: nil, "data-autocomplete": autocomplete }
|
||||
out = tag.input type: :hidden, name: :redirect, value: "1"
|
||||
out += f.input attribute, label: false, placeholder: "Search #{name}", input_html: { id: nil, "data-autocomplete": autocomplete }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user