Class: BulmaPhlex::Rails::TextDisplay
- Inherits:
-
BaseDisplay
- Object
- Base
- BaseDisplay
- BulmaPhlex::Rails::TextDisplay
- Defined in:
- lib/bulma_phlex/rails/components/displays/text_display.rb
Overview
# Text Display
A read-only text display field styled with Bulma.
An optional formatter can be provided to customize the display of the text value, such as &:titleize or a custom lambda.
#### Arguments
-
‘model`: ActiveRecord Model - The model containing the text attribute.
-
‘method`: Symbol or String - The attribute method name for the text field.
-
‘options`: Hash - Additional Bulma form field options can be passed, such as `:help`, `:icon_left`, `:icon_right`, `:column`, and `:grid`. Use the `formatter` key to provide a block or lambda for custom text formatting.
Direct Known Subclasses
Constant Summary
Constants inherited from BaseDisplay
BaseDisplay::FORM_FIELD_OPTIONS
Instance Method Summary collapse
-
#initialize(model, method, **options) ⇒ TextDisplay
constructor
A new instance of TextDisplay.
Methods inherited from BaseDisplay
Constructor Details
#initialize(model, method, **options) ⇒ TextDisplay
Returns a new instance of TextDisplay.
20 21 22 23 |
# File 'lib/bulma_phlex/rails/components/displays/text_display.rb', line 20 def initialize(model, method, **) super(model, method, **.except(:formatter)) @formatter = [:formatter] end |