From afc871deb13b2f713ad839ac300c11c704329c62 Mon Sep 17 00:00:00 2001 From: songtianlun Date: Sun, 16 Feb 2025 13:42:13 +0800 Subject: [PATCH] refactor: improve: changes in admin panel The commit message implements a new feature in the admin panel for the Sidekiq tasks allowing users to input the city ID. The previous implementation uses a selection approach where users can input the city ID. The new feature allows for a more streamlined, direct data input method for the users. --- app/admin/sidekiq_jobs.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/admin/sidekiq_jobs.rb b/app/admin/sidekiq_jobs.rb index e52bb4c..32640e2 100644 --- a/app/admin/sidekiq_jobs.rb +++ b/app/admin/sidekiq_jobs.rb @@ -12,10 +12,9 @@ ActiveAdmin.register_page "Sidekiq Tasks" do form action: admin_sidekiq_tasks_run_task_path, method: :post do input type: "hidden", name: "authenticity_token", value: form_authenticity_token input type: "hidden", name: "task", value: "GenerateWeatherArtsWorker" - select name: "city_id" do - City.all.map do |city| - option city.name, value: city.id - end + div class: "input-field" do + label "City ID" + input type: "number", name: "city_id", placeholder: "Enter city ID", required: true end input type: "submit", value: "Run Task", class: "button" end