Aircraft description stays inside the Details card

simple_format makes paragraphs, so the padded box around them is a div:
inside a <p> the browser closed it early and the text spilled out unstyled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-14 07:22:30 -05:00
1 parent 79a64cc208
commit 3452a35896
2 files changed
+9 -1

No files matched your search

+1 -1
View File
@@ -87,7 +87,7 @@
<dt class="text-slate-500"><%= t(".hobbs_offset") %></dt><dd><%= hours(@aircraft.hobbs_time_offset) %></dd> <dt class="text-slate-500"><%= t(".hobbs_offset") %></dt><dd><%= hours(@aircraft.hobbs_time_offset) %></dd>
</dl> </dl>
<% if @aircraft.description.present? %> <% if @aircraft.description.present? %>
<p class="border-t border-slate-100 px-4 py-3 text-sm text-slate-600"><%= simple_format @aircraft.description %></p> <div class="space-y-2 border-t border-slate-100 px-4 py-3 text-sm text-slate-600"><%= simple_format @aircraft.description %></div>
<% end %> <% end %>
</section> </section>
+8
View File
@@ -43,4 +43,12 @@ class MoreMenuTest < ActionDispatch::IntegrationTest
assert_select "span[title='Your access to this aircraft']", "Owner" assert_select "span[title='Your access to this aircraft']", "Owner"
assert_select "span.badge-green", text: "Available", count: 0 assert_select "span.badge-green", text: "Available", count: 0
end end
test "the description keeps its paragraphs inside the Details card" do
@a.update!(description: "First line.\n\nSecond paragraph.")
sign_in @owner
get aircraft_path(@a)
# simple_format makes <p>s, so the box around them must not be a <p> (they'd spill out of it).
assert_select "div.border-t > p", 2
end
end end