Class: Trestle::Table::ActionsColumn
- Inherits:
-
Object
- Object
- Trestle::Table::ActionsColumn
- Defined in:
- lib/trestle/table/actions_column.rb
Defined Under Namespace
Classes: ActionsBuilder, Renderer
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Instance Method Summary collapse
- #default_actions ⇒ Object
-
#initialize(table, options = {}, &block) ⇒ ActionsColumn
constructor
A new instance of ActionsColumn.
- #renderer(template) ⇒ Object
Constructor Details
#initialize(table, options = {}, &block) ⇒ ActionsColumn
Returns a new instance of ActionsColumn.
6 7 8 9 |
# File 'lib/trestle/table/actions_column.rb', line 6 def initialize(table, ={}, &block) @table, @options = table, @block = block_given? ? block : default_actions end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
4 5 6 |
# File 'lib/trestle/table/actions_column.rb', line 4 def block @block end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/trestle/table/actions_column.rb', line 4 def @options end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
4 5 6 |
# File 'lib/trestle/table/actions_column.rb', line 4 def table @table end |
Instance Method Details
#default_actions ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/trestle/table/actions_column.rb', line 15 def default_actions admin = table.admin ->(action) do action.delete if admin && admin.actions.include?(:destroy) end end |