Class: Form::Row

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Admin::Form::Row, Form
Defined in:
app/models/form/row.rb

Direct Known Subclasses

AsHeader

Defined Under Namespace

Classes: AsHeader

Instance Method Summary collapse

Instance Method Details

#js_form_selectorObject



17
18
19
# File 'app/models/form/row.rb', line 17

def js_form_selector
  "#new_form_#{model_name.element}"
end

#labelled_valuesObject



25
26
27
28
29
30
31
32
# File 'app/models/form/row.rb', line 25

def labelled_values
  columns = fields.count.times.map{ |i| "column_#{i}" }
  values = header.attributes.slice(*columns)
  values.reduce({}) do |values, (column_key, label)|
    values[label] = send(column_key)
    values
  end
end

#locale_enumObject



34
35
36
# File 'app/models/form/row.rb', line 34

def locale_enum
  I18n.available_locales
end

#send_fromObject



21
22
23
# File 'app/models/form/row.rb', line 21

def send_from
  send(email_column_key) if email_column_key
end