Class: Mensa::Action

Inherits:
Object
  • Object
show all
Includes:
ConfigReaders
Defined in:
app/tables/mensa/action.rb

Overview

Provide additional links at the end of the row, with an icon, link and a name

action :delete do

link { |contact| delete_contact_path(contact) }
link_attributes "data-turbo-method" => "delete"
icon "fa-xmark"

end

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, config:, table:) ⇒ Action

Returns a new instance of Action.



18
19
20
21
22
# File 'app/tables/mensa/action.rb', line 18

def initialize(name, config:, table:)
  @name = name
  @table = table
  @config = config
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



16
17
18
# File 'app/tables/mensa/action.rb', line 16

def name
  @name
end

#tableObject (readonly)

Returns the value of attribute table.



16
17
18
# File 'app/tables/mensa/action.rb', line 16

def table
  @table
end