Class: BulmaPhlex::Rails::FormattedDisplay
- Inherits:
-
TextDisplay
- Object
- Base
- BaseDisplay
- TextDisplay
- BulmaPhlex::Rails::FormattedDisplay
- Defined in:
- lib/bulma_phlex/rails/components/displays/formatted_display.rb
Overview
# Formatted Display
A read-only display field styled with Bulma. This requires a ‘format` option, which will be passed to `to_fs` for formatting the value.
#### Arguments
-
‘model`: ActiveRecord Model - The model containing the attribute to display.
-
‘method`: Symbol or String - The attribute method name for the field.
-
‘options`: Hash - Additional Bulma form field options can be passed, such as `:help`, `:icon_left`, `:icon_right`, `:column`, and `:grid`. Include a `format` key to specify the format to use with `to_fs`.
Constant Summary
Constants inherited from BaseDisplay
BaseDisplay::FORM_FIELD_OPTIONS
Instance Method Summary collapse
-
#initialize(model, method = nil, **options) ⇒ FormattedDisplay
constructor
A new instance of FormattedDisplay.
Methods inherited from BaseDisplay
Constructor Details
#initialize(model, method = nil, **options) ⇒ FormattedDisplay
Returns a new instance of FormattedDisplay.
18 19 20 21 |
# File 'lib/bulma_phlex/rails/components/displays/formatted_display.rb', line 18 def initialize(model, method = nil, **) super(model, method, **.except(:format)) @format = .fetch(:format, :default) end |