Files
grecia/app/components/admin/table_actions_component.rb
Javi Martín 738646a565 Allow different texts in links to actions
The texts were different for a few models, so the component needs to be
updated.
2020-10-19 18:56:02 +02:00

23 lines
430 B
Ruby

class Admin::TableActionsComponent < ApplicationComponent
attr_reader :record, :options
def initialize(record, **options)
@record = record
@options = options
end
private
def actions
options[:actions] || [:edit, :destroy]
end
def edit_text
options[:edit_text] || t("admin.actions.edit")
end
def destroy_text
options[:destroy_text] || t("admin.actions.delete")
end
end