Extract method in cards table component
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= ::Widget::Card.human_attribute_name(:title) %></th>
|
||||
<th class="small-4"><%= ::Widget::Card.human_attribute_name(:description) %></th>
|
||||
<th><%= ::Widget::Card.human_attribute_name(:link_text) %> / <%= ::Widget::Card.human_attribute_name(:link_url) %></th>
|
||||
<th><%= attribute_name(:title) %></th>
|
||||
<th class="small-4"><%= attribute_name(:description) %></th>
|
||||
<th><%= attribute_name(:link_text) %> / <%= attribute_name(:link_url) %></th>
|
||||
<th><%= t("admin.shared.image") %></th>
|
||||
<th><%= t("admin.shared.actions") %></th>
|
||||
</tr>
|
||||
|
||||
@@ -5,4 +5,10 @@ class Admin::Widget::Cards::TableComponent < ApplicationComponent
|
||||
@cards = cards
|
||||
@no_cards_message = no_cards_message
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def attribute_name(attribute)
|
||||
::Widget::Card.human_attribute_name(attribute)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user