Class: Ezframe::TextareaType

Inherits:
TextType show all
Defined in:
lib/ezframe/column_type.rb

Instance Attribute Summary

Attributes inherited from TypeBase

#attribute, #error, #parent

Instance Method Summary collapse

Methods inherited from TextType

#db_type, #normalize

Methods inherited from TypeBase

#db_type, #db_value, get_class, #initialize, #key, #label, #make_error_box, #multi_inputs?, #no_edit?, #no_view?, #normalize, #type, type_name, #use_view_format, #validate, #value, #view

Constructor Details

This class inherits a constructor from Ezframe::TypeBase

Instance Method Details

#form(opts = {}) ⇒ Object



152
153
154
155
156
157
158
159
160
161
# File 'lib/ezframe/column_type.rb', line 152

def form(opts = {})
  return nil if no_edit? && !opts[:force]
  val = @value
  key = self.key
  key ="#{key}#{opts[:key_suffix]}" if opts[:key_suffix]
  h = Ht.textarea(name: key, label: @attribute[:label], child: val)
  h[:class] = @attribute[:class] if @attribute[:class]
  h[:after] = make_error_box(key)
  return h
end

#value=(val) ⇒ Object



147
148
149
150
# File 'lib/ezframe/column_type.rb', line 147

def value=(val)
  @value = normalize(val)
  @value = val
end