Fix BetterHtml::DontInterpolateHere in _html_modal.html.erb

Move aria-labelledby conditional to a local variable above the tag
so the attribute uses a <%= %> expression instead of <% %> inside the tag.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
pull/599/head
Marcelo Paiva 3 weeks ago
parent 921d5d8e82
commit 9d2297f65e

@ -1,7 +1,8 @@
<% uuid = local_assigns[:uuid] || SecureRandom.uuid %> <% uuid = local_assigns[:uuid] || SecureRandom.uuid %>
<% modal_labelledby = local_assigns[:title] ? "modal-title-#{uuid}" : nil %>
<input type="checkbox" id="<%= uuid %>" class="modal-toggle"> <input type="checkbox" id="<%= uuid %>" class="modal-toggle">
<div id="<%= local_assigns[:id] %>" class="modal items-start !animate-none overflow-y-auto"> <div id="<%= local_assigns[:id] %>" class="modal items-start !animate-none overflow-y-auto">
<div class="modal-box pt-4 pb-6 px-6 mt-20 max-h-none" role="dialog" aria-modal="true"<% if local_assigns[:title] %> aria-labelledby="modal-title-<%= uuid %>"<% end %>> <div class="modal-box pt-4 pb-6 px-6 mt-20 max-h-none" role="dialog" aria-modal="true" aria-labelledby="<%= modal_labelledby %>">
<% if local_assigns[:title] %> <% if local_assigns[:title] %>
<div class="flex justify-between items-center border-b pb-2 mb-2 font-medium"> <div class="flex justify-between items-center border-b pb-2 mb-2 font-medium">
<span id="modal-title-<%= uuid %>"> <span id="modal-title-<%= uuid %>">

Loading…
Cancel
Save