Class: Lolita::Components::Configuration::ColumnComponent
- Defined in:
- lib/lolita/components/configuration/column_component.rb
Overview
Should include routes helper and lolita urls helpers
-
nested_list_options = column.list && {} || {}
-
content_text = column.formatted_value(record,self)
%td=> column.list && “with-nested-list”.merge(nested_list_options)}= column.list ? link_to(content_text,“#”) : content_text
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #nested_list_options(parent) ⇒ Object
- #td_attributes(record) ⇒ Object
- #td_value(record, view) ⇒ Object
Methods inherited from Base
Constructor Details
This class inherits a constructor from Lolita::Components::Base
Instance Method Details
#nested_list_options(parent) ⇒ Object
22 23 24 25 26 |
# File 'lib/lolita/components/configuration/column_component.rb', line 22 def parent parent.list && { :"data-nested-list-url" => lolita_resources_path(column.list.mapping, column.list.(record)) } end |
#td_attributes(record) ⇒ Object
12 13 14 15 16 |
# File 'lib/lolita/components/configuration/column_component.rb', line 12 def td_attributes(record) { :class => parent.list && "with-nested-list" }.merge((record)) end |
#td_value(record, view) ⇒ Object
18 19 20 |
# File 'lib/lolita/components/configuration/column_component.rb', line 18 def td_value(record,view) column.formatted_value(record) end |