From 33fb371fdc5473fc0e8b357a633ce657ea78c15a Mon Sep 17 00:00:00 2001 From: Katya Sarmiento <5871075+Kitkatnik@users.noreply.github.com> Date: Thu, 30 Apr 2026 11:10:22 -0400 Subject: [PATCH] Admin schedule: pair host_url with host so speaker links don't drift The admin form let admins change a talk's host name via the dropdown, but had no field for host_url and didn't permit it in strong params. Editing a talk's host left host_url pointing at the previous speaker's profile, so the rendered name and link disagreed in production. Add a Speaker profile URL field next to the host dropdown (mirroring :map_url) and permit :host_url in schedule_item_params. Add regression tests for both the form field and the update round-trip. --- .../admin/schedule_items_controller.rb | 2 +- app/views/admin/schedule_items/_form.html.erb | 10 ++++++ .../admin/schedule_items_controller_test.rb | 31 +++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/schedule_items_controller.rb b/app/controllers/admin/schedule_items_controller.rb index c17aaa4..9281092 100644 --- a/app/controllers/admin/schedule_items_controller.rb +++ b/app/controllers/admin/schedule_items_controller.rb @@ -84,7 +84,7 @@ def safe_return_to # config/schedule.yml items and should never be set by hand. def schedule_item_params attrs = params.require(:schedule_item).permit( - :day, :time_label, :sort_time, :title, :host, + :day, :time_label, :sort_time, :title, :host, :host_url, :location, :map_url, :description, :kind, :flexible, :is_public, :audience, :offers_new_passport, :offers_stamping, :offers_passport_pickup, :new_passport_capacity, :stamping_capacity, :passport_pickup_capacity, diff --git a/app/views/admin/schedule_items/_form.html.erb b/app/views/admin/schedule_items/_form.html.erb index f0297ea..e88e3a5 100644 --- a/app/views/admin/schedule_items/_form.html.erb +++ b/app/views/admin/schedule_items/_form.html.erb @@ -71,6 +71,16 @@ class: "select" %> +
+ Optional. If set, the speaker's name links to this URL on /schedule and /plan. + Update this whenever you change the host so the link points to the right person. +
+