Allow cards table actions to receive options
Just like we sometimes override options in the generic table actions component, we're going to do the same thing with the cards table actions.
This commit is contained in:
@@ -17,6 +17,6 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<%= render Admin::TableActionsComponent.new(card) %>
|
<%= render Admin::TableActionsComponent.new(card, options) %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
class Admin::Widget::Cards::RowComponent < ApplicationComponent
|
class Admin::Widget::Cards::RowComponent < ApplicationComponent
|
||||||
attr_reader :card
|
attr_reader :card, :options
|
||||||
|
|
||||||
def initialize(card)
|
def initialize(card, **options)
|
||||||
@card = card
|
@card = card
|
||||||
|
@options = options
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% cards.each do |card| %>
|
<% cards.each do |card| %>
|
||||||
<%= render Admin::Widget::Cards::RowComponent.new(card) %>
|
<%= render Admin::Widget::Cards::RowComponent.new(card, options) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
class Admin::Widget::Cards::TableComponent < ApplicationComponent
|
class Admin::Widget::Cards::TableComponent < ApplicationComponent
|
||||||
attr_reader :cards, :no_cards_message
|
attr_reader :cards, :no_cards_message, :options
|
||||||
|
|
||||||
def initialize(cards, no_cards_message:)
|
def initialize(cards, no_cards_message:, **options)
|
||||||
@cards = cards
|
@cards = cards
|
||||||
@no_cards_message = no_cards_message
|
@no_cards_message = no_cards_message
|
||||||
|
@options = options
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
Reference in New Issue
Block a user