Sha256: cc54a7ea15e4d98f74981c595262dd073015b9300be346df992abbdd27e7e17d

Contents?: true

Size: 370 Bytes

Versions: 7

Compression:

Stored size: 370 Bytes

Contents

module Para
  module AttributeField
    class BooleanField < AttributeField::Base
      register :boolean, :bool, self

      field_option :wrapper, :wrapper_name

      def value_for(instance)
        ::I18n.t("para.types.boolean.#{ (!!instance.send(name)).to_s }")
      end

      def wrapper_name
        :horizontal_radio_and_checkboxes
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
para-0.6.9 lib/para/attribute_field/boolean.rb
para-0.6.8 lib/para/attribute_field/boolean.rb
para-0.6.7 lib/para/attribute_field/boolean.rb
para-0.6.3 lib/para/attribute_field/boolean.rb
para-0.6.2 lib/para/attribute_field/boolean.rb
para-0.5.4 lib/para/attribute_field/boolean.rb
para-0.5.3 lib/para/attribute_field/boolean.rb