Have single result searches go to the show pages for certain controllers #4204

This commit is contained in:
evazion
2019-11-04 14:24:10 -06:00
parent 953de62d70
commit 6e5e07022d
6 changed files with 25 additions and 14 deletions

View File

@@ -169,8 +169,10 @@ 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|
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 }
out = 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 += capture { yield f } if block_given?
out
end
end
end