autocomplete: fix favgroup:<name> returning favgroups for other users.

* Fix favgroup:<name> autocompletion to only return favgroups for the
  current user.
* Add favgroup autocomplete to the /favorite_groups search form.
This commit is contained in:
evazion
2020-01-22 11:21:16 -06:00
parent edaf6323fd
commit 9d71c77524
2 changed files with 5 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
<div id="c-favorite-groups">
<div id="a-index">
<%= search_form_for(favorite_groups_path) do |f| %>
<%= f.input :name_matches, label: "Name", input_html: { value: params.dig(:search, :name_matches) } %>
<%= f.input :name_matches, label: "Name", input_html: { value: params.dig(:search, :name_matches), "data-autocomplete": "favorite-group" } %>
<%= f.input :creator_name, label: "Creator", input_html: { value: params.dig(:search, :creator_name), "data-autocomplete": "user" } %>
<%= f.input :order, collection: [%w[Created created_at], %w[Updated updated_at], %w[Name name], %w[Post\ count post_count]], include_blank: true, selected: params.dig(:search, :order) %>
<%= f.submit "Search" %>