From f0ae0eef9949a58aeed944ed4f89df36dba61230 Mon Sep 17 00:00:00 2001 From: pvincent Date: Fri, 23 Aug 2024 08:30:45 +0400 Subject: [PATCH] search_field seems ok --- app/views/scores/_score.html.erb | 2 +- app/views/scores/_scores.html.erb | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/views/scores/_score.html.erb b/app/views/scores/_score.html.erb index 5478f33..c4006ec 100644 --- a/app/views/scores/_score.html.erb +++ b/app/views/scores/_score.html.erb @@ -1,6 +1,6 @@ - <%= score.name %> + <%= highlight(score.name, params.dig(:q,:name_cont)) %> <%= score.grade %> diff --git a/app/views/scores/_scores.html.erb b/app/views/scores/_scores.html.erb index 0d14e72..7cc3b61 100644 --- a/app/views/scores/_scores.html.erb +++ b/app/views/scores/_scores.html.erb @@ -1,4 +1,13 @@ <%= turbo_frame_tag :scores do %> + + <%= search_form_for @q do |f| %> + + <%= f.label :name_cont %> + <%= f.search_field :name_cont %> + + <%= f.submit %> + <% end %> +