Module: CoreFormTextareaHelper

Defined in:
app/helpers/core_form_textarea_helper.rb

Instance Method Summary collapse

Instance Method Details

#form_text_area(model, field, options = {}) ⇒ Object Also known as: form_textarea

Text area



5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/helpers/core_form_textarea_helper.rb', line 5

def form_text_area(model, field, options = {})
  classes = options[:classes] || %w[s12]
  value = model.send(field)
  # options[:value] = value
  # options[:disabled] ||= false
  # tag_options = {class: []} # text_field_options(model, field, options)
  # tag_options[:class] += ['materialize-textarea']
  (:div, class: (%w[input-field col] + classes).join(' ')) do
    concat(form_label_tag(model, field, value, options))
    concat(text_area_tag(model, field, value, options))
  end
end

#text_area_tag(model, field, value, options = {}) ⇒ Object



19
20
21
22
23
24
25
# File 'app/helpers/core_form_textarea_helper.rb', line 19

def text_area_tag(model, field, value, options = {})
tag_options = text_field_options(model, field, options)
tag_options[:class] += ['form-control']
(:textarea, tag_options) do
  concat(value)
end
end