Class: Symphonia::ModelAttributes::BooleanAttribute

Inherits:
Attribute
  • Object
show all
Defined in:
lib/symphonia/model_attributes/attribute.rb

Instance Attribute Summary

Attributes inherited from Attribute

#filter, #format_options, #name, #options, #sort_column

Instance Method Summary collapse

Methods inherited from Attribute

#default?, #filter?, #format, #initialize, #input_options, #required?, #sort=, #sort?, #title, #value

Constructor Details

This class inherits a constructor from Symphonia::ModelAttributes::Attribute

Instance Method Details

#format_value(view, value, _entity) ⇒ Object



165
166
167
168
169
170
171
# File 'lib/symphonia/model_attributes/attribute.rb', line 165

def format_value(view, value, _entity)
  if value.to_s == "true"
    view.icon('true', view.t(:true))
  else
    view.icon('false', view.t(:false))
  end
end

#input_fieldObject



173
174
175
# File 'lib/symphonia/model_attributes/attribute.rb', line 173

def input_field
  :check_box
end