Class: Formatic::Base
- Inherits:
-
ApplicationComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- Formatic::Base
- Defined in:
- app/components/formatic/base.rb
Overview
All inputs inherit from this class.
Instance Method Summary collapse
-
#input_name ⇒ Object
# Name of the URL param for this input.
-
#param_key ⇒ Object
Name of the URL param for this record.
- #value ⇒ Object
- #wrapper ⇒ Object
Methods inherited from ApplicationComponent
Constructor Details
This class inherits a constructor from Formatic::ApplicationComponent
Instance Method Details
#input_name ⇒ Object
# Name of the URL param for this input.
79 80 81 |
# File 'app/components/formatic/base.rb', line 79 def input_name "#{param_key}[#{attribute_name}]#{'[]' if multiple}" end |
#param_key ⇒ Object
Name of the URL param for this record.
74 75 76 |
# File 'app/components/formatic/base.rb', line 74 def param_key f.object.model_name.param_key end |
#value ⇒ Object
63 64 65 66 67 |
# File 'app/components/formatic/base.rb', line 63 def value return manual_value if manual_value != :_fetch_from_record f.object.public_send(attribute_name) if f.object.respond_to?(attribute_name) end |