From b4c6f93f68ddd177840b8ef8656fd3f999216ba7 Mon Sep 17 00:00:00 2001 From: Ken Johnson Date: Sun, 7 Dec 2025 21:54:46 +0000 Subject: [PATCH] Add debugging and fix form field attributes in admin modal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add console logging to openEditModal function to debug AJAX load - Add explicit id and name attributes to admin select field - Only show modal after content successfully loads - Log errors if modal content fails to load This helps diagnose the modal loading issue and fixes the Chrome warning about form fields lacking id/name attributes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/views/admin/get_all_users.html.erb | 14 +++++++++++--- app/views/admin/get_user.html.erb | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/views/admin/get_all_users.html.erb b/app/views/admin/get_all_users.html.erb index c56307e..cba47c0 100755 --- a/app/views/admin/get_all_users.html.erb +++ b/app/views/admin/get_all_users.html.erb @@ -51,9 +51,17 @@ function openEditModal(id){ var link = '/admin/'+ id +'/get_user'; - $("#editAcct .modal-content").load(link); - var modal = new bootstrap.Modal(document.getElementById('editAcct')); - modal.show(); + console.log('Loading modal content from:', link); + + $("#editAcct .modal-content").load(link, function(response, status, xhr) { + console.log('Load status:', status); + if (status == "success") { + var modal = new bootstrap.Modal(document.getElementById('editAcct')); + modal.show(); + } else { + console.error('Failed to load modal content:', xhr.statusText); + } + }); }; function dataTablePagination(){ diff --git a/app/views/admin/get_user.html.erb b/app/views/admin/get_user.html.erb index 9fcfe17..806fbab 100755 --- a/app/views/admin/get_user.html.erb +++ b/app/views/admin/get_user.html.erb @@ -34,7 +34,7 @@
<%= f.label :admin, nil, {:class => "form-label"}%> - <%= f.select(:admin, @admin_select, {}, {:class => "form-select"}) %> + <%= f.select(:admin, @admin_select, {}, {:class => "form-select", :id => "user_admin", :name => "user[admin]"}) %>