Files
nairobi/app/components/admin/widget/cards/table_component.rb
Javi Martín 9cc0ad0ba9 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.
2021-02-26 16:17:18 +01:00

16 lines
371 B
Ruby

class Admin::Widget::Cards::TableComponent < ApplicationComponent
attr_reader :cards, :no_cards_message, :options
def initialize(cards, no_cards_message:, **options)
@cards = cards
@no_cards_message = no_cards_message
@options = options
end
private
def attribute_name(attribute)
::Widget::Card.human_attribute_name(attribute)
end
end