Class: Lolita::Components::Configuration::ColumnComponent

Inherits:
Base
  • Object
show all
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

#parent

Instance Method Summary collapse

Methods inherited from Base

#initialize

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 nested_list_options parent
  parent.list && {
    :"data-nested-list-url" => lolita_resources_path(column.list.mapping, column.list.nested_options_for(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(nested_list_options(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