Sha256: 280406c797db508a82bacc66305fea4e6fa7622983569d08f9f37d6e283d4b30
Contents?: true
Size: 919 Bytes
Versions: 14
Compression:
Stored size: 919 Bytes
Contents
class C2::Informant::FormElement include Mongoid::Document field :tag field :name field :caption field :tip field :enabled, :type => Boolean, :default => true embedded_in :locus, :class_name => 'C2::Informant::Locus' scope :enabled, :where => { :enabled => true } delegate :klass, :to => :'_parent' def as_json(options={}) { 'type' => 'div', 'id' => "entry_#{name}_field", 'class' => "field #{name}_field #{tag}", 'elements' => [ { 'type' => tag, 'name' => name, 'id' => "entry_#{name}", 'class' => "#{name}_input #{tag}", 'caption' => (caption || name.titleize) }, { 'type' => 'div', 'class' => 'tip', 'elements' => [ { 'type' => 'p', 'html' => tip } ] } ] } end end
Version data entries
14 entries across 14 versions & 1 rubygems