From 806bb862c2fb926414e4810ce55a2601f2449876 Mon Sep 17 00:00:00 2001 From: junyi Date: Thu, 30 Jul 2026 09:57:41 +0000 Subject: [PATCH] Auto-fill current time for postdate field on new active page The postdate datetime field was left blank on the "new" active creation page because orbit_form_helper.rb intentionally clears :new_record fields regardless of the model's :default value. Add inline JS (mirroring the pattern used in announcement-test) to fill act[postdate] with the current date/time only when the URL path ends in "new", so existing records are not overwritten on edit. --- app/views/admin/actives/_form.html.erb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/views/admin/actives/_form.html.erb b/app/views/admin/actives/_form.html.erb index 7d0c65a..928a80a 100644 --- a/app/views/admin/actives/_form.html.erb +++ b/app/views/admin/actives/_form.html.erb @@ -404,6 +404,12 @@ <% content_for :page_specific_javascript do %>