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.



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

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

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



13
14
15
# File 'app/tables/mensa/action.rb', line 13

def config
  @config
end

#nameObject (readonly)

Returns the value of attribute name.



13
14
15
# File 'app/tables/mensa/action.rb', line 13

def name
  @name
end

#tableObject (readonly)

Returns the value of attribute table.



13
14
15
# File 'app/tables/mensa/action.rb', line 13

def table
  @table
end