Module: IronAdmin::Form::Concerns::FormInputBehavior
- Extended by:
- ActiveSupport::Concern
- Included in:
- BelongsToAutocompleteComponent
- Defined in:
- app/components/iron_admin/form/concerns/form_input_behavior.rb
Overview
Shared behavior for form input components.
Provides field-level readonly checks and theme access. Included by all form input components.
Instance Method Summary collapse
-
#effectively_disabled? ⇒ Boolean
Checks if input should be disabled (explicitly or via field readonly).
-
#field_readonly? ⇒ Boolean
Checks if field is readonly for the current user.
-
#theme ⇒ IronAdmin::Configuration::Theme
Returns the theme configuration.
Instance Method Details
#effectively_disabled? ⇒ Boolean
Checks if input should be disabled (explicitly or via field readonly).
28 29 30 |
# File 'app/components/iron_admin/form/concerns/form_input_behavior.rb', line 28 def effectively_disabled? disabled || field_readonly? end |
#field_readonly? ⇒ Boolean
Checks if field is readonly for the current user.
35 36 37 |
# File 'app/components/iron_admin/form/concerns/form_input_behavior.rb', line 35 def field_readonly? @field&.readonly?(@current_user) || false end |
#theme ⇒ IronAdmin::Configuration::Theme
Returns the theme configuration.
42 43 44 |
# File 'app/components/iron_admin/form/concerns/form_input_behavior.rb', line 42 def theme IronAdmin.configuration.theme end |