Module: Lolita::Configuration::Field

Defined in:
lib/lolita/configuration/field.rb,
lib/lolita/configuration/field/date.rb,
lib/lolita/configuration/field/enum.rb,
lib/lolita/configuration/field/hash.rb,
lib/lolita/configuration/field/time.rb,
lib/lolita/configuration/field/array.rb,
lib/lolita/configuration/field/float.rb,
lib/lolita/configuration/field/range.rb,
lib/lolita/configuration/field/hidden.rb,
lib/lolita/configuration/field/string.rb,
lib/lolita/configuration/field/symbol.rb,
lib/lolita/configuration/field/boolean.rb,
lib/lolita/configuration/field/integer.rb,
lib/lolita/configuration/field/date_time.rb,
lib/lolita/configuration/field/big_decimal.rb

Overview

Lolita::Configuration::Field is class that allow to configure fields. To change behaviour of field you can use these attributes

  • name - field name, used to set or get value from related ORM object

  • type - can change the way field is shown and how data is formated

  • on - when to show field on hide, accepts array or symbol. Possible states are :create, :update or proc

  • field_set - define field set that field belongs to. See Lolita::Configuration::FieldSet

  • nested_in - define field for different Lolita::DBI instance, than given. This is used to create nested fields in one form for related models. Like user and profile, where in user form there are fields from profile that can be manipulated when user is changed or created.

  • options - specific options for different type of fields, see Lolita::Configuration::FieldExtensions for details

  • html_options - used to change field HTML output,like class or style etc.

To define field in ORM class through lolita configuration block

Example

lolita do
  tab do
    field :email
    field :user_id, :type=>"string"
    field :body do
       title "Full text"
       html_options :class=>"full_text"
    end
  end
end

Defined Under Namespace

Classes: Array, Base, BigDecimal, Boolean, Date, DateTime, Enum, Float, Hash, Hidden, Integer, Range, String, Symbol, Time