Class: KonoUtils::Object::Cell::Index::Row

Inherits:
Base
  • Object
show all
Defined in:
app/concepts/kono_utils/object/cell/index/row.rb

Overview

class

Direct Known Subclasses

RowFooter, RowHeader

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#_prefixes, #base_class, #concept, #content_for_layout, #content_for_layout?, #destroy_custom_polymorphic_path, #edit_custom_polymorphic_path, #index_custom_polymorphic_path, #kono_user, #legacy_concept, logger, #model_gender, #new_custom_polymorphic_path, #show_custom_polymorphic_path, #title_del, #title_del_g, #title_edit_g, #title_mod, #title_new, #title_new_g, #title_newa, #title_show_g

Methods included from KonoUtilsBootstrapView4::ApplicationIconHelper

#fa_icon, #icon

Instance Attribute Details

#model -> record della riga che stiamo stampando(->recorddellarigachestiamostampando) ⇒ Object (readonly)



# File 'app/concepts/kono_utils/object/cell/index/row.rb', line 7

Instance Method Details

#column_builder(field, column) {|column_class, column_id| ... } ⇒ Object

Questa funzione serve per generare la colonna della tabella

Parameters:

  • field (String)

    campo che mi identifica il valore del record

  • column (Symbol)

    tipo di colonna (:td,:th)

Yield Parameters:

  • column_class (String)

    stringa contenente la classe della colonna

  • column_id (String)

    stringa contenente l’id generato aggiunto cul tag della colonna

Yield Returns:

  • (String)

    contenuto da inserire nella colonna



25
26
27
28
29
30
31
32
33
34
35
36
# File 'app/concepts/kono_utils/object/cell/index/row.rb', line 25

def column_builder(field, column)
  column_class = "column_#{field}"
  column_id = ''
  if model
    column_id = "#{column_class}-#{dom_id(model)}"
  end
   column, class: column_class, id: column_id do
    capture do
      yield column_class, column_id
    end.html_safe
  end
end

Questa funzione serve per essere sovrascritta nell’helper specializzato del controller

Parameters:

  • field (Symbol)

    campo da renderizzare

Returns:

  • (Object)

    valore da visualizzare nella colonna



13
14
15
# File 'app/concepts/kono_utils/object/cell/index/row.rb', line 13

def print_column(field)
  model.send(field)
end