Skip to content
This repository was archived by the owner on Jul 25, 2025. It is now read-only.

Commit f02ae44

Browse files
committed
Refactor FAQs index view for improved layout and styling
- Updated the FAQs index view to enhance the layout by using a grid system for better responsiveness. - Removed unnecessary elements and simplified the display of FAQ categories. - Cleaned up the code by eliminating commented-out sections and unused classes for improved readability.
1 parent b597578 commit f02ae44

1 file changed

Lines changed: 3 additions & 17 deletions

File tree

app/views/faqs/index.html.erb

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,12 @@
3131
<%= faq.question %>
3232
</h3>
3333
<% if faq.category.present? %>
34-
<div class="mb-3">
34+
<div class="">
3535
<span class="inline-block px-3 py-1 text-xs font-medium bg-gray-100 text-gray-600 rounded-full">
3636
<%= faq.category %>
3737
</span>
3838
</div>
3939
<% end %>
40-
<p class="text-sm text-gray-600 leading-relaxed">
41-
<%= truncate(strip_tags(faq.answer), length: 120, separator: ' ') %>
42-
</p>
43-
<div class="mt-4 flex items-center text-sm font-medium text-gray-900">
44-
Read answer
45-
<%= lucide_icon "chevron-right", class: "ml-1 w-4 h-4" %>
46-
</div>
4740
<% end %>
4841
<% end %>
4942
</div>
@@ -54,19 +47,12 @@
5447
<% faqs_grouped.sort.each do |category_name, category_faqs| %>
5548
<div class="mb-12">
5649
<h2 class="text-2xl font-semibold mb-6 text-gray-900"><%= category_name %></h2>
57-
<div class="space-y-4">
50+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 mb-8">
5851
<% category_faqs.each do |faq| %>
5952
<%= link_to faq_path(faq), class: "block bg-white p-6 rounded-lg border shadow-xs hover:shadow-sm transition-shadow duration-200" do %>
60-
<h3 class="text-lg font-semibold mb-3 text-gray-900 leading-tight">
53+
<h3 class="text-lg font-semibold text-gray-900 leading-tight">
6154
<%= faq.question %>
6255
</h3>
63-
<p class="text-sm text-gray-600 leading-relaxed">
64-
<%= truncate(strip_tags(faq.answer), length: 120, separator: ' ') %>
65-
</p>
66-
<div class="mt-4 flex items-center text-sm font-medium text-gray-900">
67-
Read answer
68-
<%= lucide_icon "chevron-right", class: "ml-1 w-4 h-4" %>
69-
</div>
7056
<% end %>
7157
<% end %>
7258
</div>

0 commit comments

Comments
 (0)