Module: DobroHelper

Defined in:
app/helpers/dobro_helper.rb

Instance Method Summary collapse

Instance Method Details

#dobro_field_for(form, column) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/helpers/dobro_helper.rb', line 8

def dobro_field_for(form, column)
  column_name = column.name.to_sym
  case column.type.to_sym
  when :integer
    form.text_field column_name, :class => 'integer'
  when :date
    form.text_field column_name, :placeholder => 'yyyy-mm-dd'
  when :text
    form.text_area column_name
  when :boolean
    form.check_box column_name
  else
    form.text_field column_name
  end
end

#standard_dobro_columnsObject



2
3
4
5
6
# File 'app/helpers/dobro_helper.rb', line 2

def standard_dobro_columns
  singular_class.columns.select { |column|
    !hidden_dobro_column_names.include?(column.name.to_s)
  }
end