-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Retain persistent params when performing searches
- Loading branch information
Showing
1 changed file
with
3 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
<div class="searchbox"> | ||
<%= form_tag admin.path, method: :get, data: { turbo_frame: "main" } do %> | ||
<%= serialize_persistent_params except: :q %> | ||
|
||
<div class="input-group"> | ||
<%= label_tag :q, icon("fas fa-search"), class: "input-group-text" %> | ||
<%= search_field_tag :q, params[:q], class: "form-control", autocomplete: "off", placeholder: admin.t("search.placeholder", default: "Search") %> | ||
<%= link_to icon("fas fa-times"), admin.path, class: "btn btn-clear-search", data: { turbo_frame: "main" } if params[:q].present? %> | ||
<%= link_to icon("fas fa-times"), admin.path(nil, persistent_params.except(:q)), class: "btn btn-clear-search", data: { turbo_frame: "main" } if params[:q].present? %> | ||
</div> | ||
<% end %> | ||
</div> |