From 7fa749aa37d4b85c9495c533acc37ae83ebd271c Mon Sep 17 00:00:00 2001 From: igorSimash Date: Sun, 3 Nov 2024 00:18:52 +0200 Subject: [PATCH] added clear filters btn for ransack form --- app/views/account/shared/_search_form.html.erb | 1 + config/locales/en/layouts.yml | 1 + config/locales/uk/layouts.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/app/views/account/shared/_search_form.html.erb b/app/views/account/shared/_search_form.html.erb index c055dd228..12ab6be3a 100644 --- a/app/views/account/shared/_search_form.html.erb +++ b/app/views/account/shared/_search_form.html.erb @@ -2,5 +2,6 @@ <%= search_form_for(q, url: search_url, method: :get, class: "d-flex mb-5") do |f| %> <%= f.search_field search_attribute, placeholder: t(".search_placeholder"), class: "form-input me-2" %> <%= f.button t(".search_button"), class: "btn btn-blue px-4 items-center" %> + <%= link_to t(".clear_button"), search_url, class:"btn btn-grey px-4 items-center ml-2" %> <% end %> diff --git a/config/locales/en/layouts.yml b/config/locales/en/layouts.yml index e7ea8f9fb..c57da2cdd 100644 --- a/config/locales/en/layouts.yml +++ b/config/locales/en/layouts.yml @@ -14,3 +14,4 @@ en: search_form: search_placeholder: "Search" search_button: "Search" + clear_button: "Clear" diff --git a/config/locales/uk/layouts.yml b/config/locales/uk/layouts.yml index 08e8dcdb4..1779a014c 100644 --- a/config/locales/uk/layouts.yml +++ b/config/locales/uk/layouts.yml @@ -14,3 +14,4 @@ uk: search_form: search_placeholder: "Пошук" search_button: "Шукати" + clear_button: "Очистити"