Add debugging and fix form field attributes in admin modal

- 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 <noreply@anthropic.com>
This commit is contained in:
Ken Johnson
2025-12-07 21:54:46 +00:00
parent 779bece728
commit b4c6f93f68
2 changed files with 12 additions and 4 deletions
+9 -1
View File
@@ -51,9 +51,17 @@
function openEditModal(id){
var link = '/admin/'+ id +'/get_user';
$("#editAcct .modal-content").load(link);
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(){
+1 -1
View File
@@ -34,7 +34,7 @@
<div class="mb-3">
<%= 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]"}) %>
</div>
</div>
<div class="modal-footer">