From 82080f55a15e670bb0af9a881b7461eec96b4409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Sun, 11 Aug 2024 10:19:48 +0800 Subject: [PATCH] Add blank option in search field for multiple search. --- app/controllers/universal_tables_controller.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/controllers/universal_tables_controller.rb b/app/controllers/universal_tables_controller.rb index d73249f..a773d47 100644 --- a/app/controllers/universal_tables_controller.rb +++ b/app/controllers/universal_tables_controller.rb @@ -44,6 +44,9 @@ class UniversalTablesController < ApplicationController if tc.make_categorizable select_values = tc.column_entries.distinct("text.#{I18n.locale.to_s}") form_field = "#{csrf_input}" + if field_value.nil? + select_values.insert(0, "") + end select_values.each do |sv| if field_value && sv == field_value selected = " selected"