Class: Symphonia::ModelAttributes::EnumAttribute
- 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
-
#format_value(view, value, _entity) ⇒ Object
TODO: @klass.name || @klass.base_class.name || entity.class.name.
- #input_field ⇒ Object
- #input_options ⇒ Object
Methods inherited from Attribute
#default?, #filter?, #format, #initialize, #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
TODO: @klass.name || @klass.base_class.name || entity.class.name
108 109 110 |
# File 'lib/symphonia/model_attributes/attribute.rb', line 108 def format_value(view, value, _entity) view.t("#{@klass.name.underscore}.#{name.to_s.pluralize}.#{value}", **) end |
#input_field ⇒ Object
112 113 114 |
# File 'lib/symphonia/model_attributes/attribute.rb', line 112 def input_field :select end |
#input_options ⇒ Object
116 117 118 |
# File 'lib/symphonia/model_attributes/attribute.rb', line 116 def [] end |