Class: Avo::Fields::TextField
- Defined in:
- lib/avo/fields/text_field.rb
Direct Known Subclasses
DateField, HiddenField, NumberField, PasswordField, TextareaField
Defined Under Namespace
Classes: EditComponent, IndexComponent, ShowComponent
Instance Attribute Summary collapse
-
#as_html ⇒ Object
readonly
Returns the value of attribute as_html.
-
#link_to_resource ⇒ Object
readonly
Returns the value of attribute link_to_resource.
Attributes inherited from BaseField
#action, #as_avatar, #as_description, #as_label, #block, #computable, #computed, #computed_value, #default, #format_using, #help, #id, #model, #null_values, #nullable, #panel_name, #readonly, #required, #resource, #sortable, #updatable, #user, #view, #visible
Attributes included from FieldExtensions::VisibleInDifferentViews
#show_on_edit, #show_on_index, #show_on_new, #show_on_show
Instance Method Summary collapse
-
#initialize(id, **args, &block) ⇒ TextField
constructor
A new instance of TextField.
Methods inherited from BaseField
#component_for_view, #custom?, #database_id, #fill_field, #has_own_panel?, #hydrate, #model_errors, #name, #placeholder, #resolve_attribute, #to_permitted_param, #translation_key, #type, #value, #view_component_name, #visible?
Methods included from FieldExtensions::HasFieldName
Methods included from FieldExtensions::VisibleInDifferentViews
#except_on, #hide_on, #only_on, #show_on
Constructor Details
#initialize(id, **args, &block) ⇒ TextField
Returns a new instance of TextField.
7 8 9 10 11 12 |
# File 'lib/avo/fields/text_field.rb', line 7 def initialize(id, **args, &block) super(id, **args, &block) @link_to_resource = args[:link_to_resource].present? ? args[:link_to_resource] : false @as_html = args[:as_html].present? ? args[:as_html] : false end |
Instance Attribute Details
#as_html ⇒ Object (readonly)
Returns the value of attribute as_html.
5 6 7 |
# File 'lib/avo/fields/text_field.rb', line 5 def as_html @as_html end |
#link_to_resource ⇒ Object (readonly)
Returns the value of attribute link_to_resource.
4 5 6 |
# File 'lib/avo/fields/text_field.rb', line 4 def link_to_resource @link_to_resource end |