Class: Ezframe::CheckboxType

Inherits:
TypeBase 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 TypeBase

#db_value, #form_html, get_class, #initialize, #key, #label, #multi_inputs?, #no_edit?, #no_view?, #normalize, type_name, #validate, #value, #value=, #view

Constructor Details

This class inherits a constructor from Ezframe::TypeBase

Instance Method Details

#db_typeObject



261
262
263
# File 'lib/ezframe/column_type.rb', line 261

def db_type
  return "text"
end

#form(opts = {}) ⇒ Object



254
255
256
257
258
259
# File 'lib/ezframe/column_type.rb', line 254

def form(opts = {})
  return nil if no_edit? && !opts[:force]
  h = Ht.checkbox(name: self.key, value: parent[:id].value, label: @attribute[:label])
  h[:class] = @attribute[:class] if @attribute[:class]
  return h
end