Class: EasyAdmin::FormLayoutComponent
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- EasyAdmin::FormLayoutComponent
- Includes:
- FieldsHelper
- Defined in:
- app/components/easy_admin/form_layout_component.rb
Instance Method Summary collapse
-
#initialize(resource_class:, form:, record: nil) ⇒ FormLayoutComponent
constructor
A new instance of FormLayoutComponent.
- #view_template ⇒ Object
Methods included from FieldsHelper
#field_component, #render_field
Methods inherited from BaseComponent
#easy_admin_url_helpers, #helpers, #rails_url_helpers
Methods included from Permissions::Component
#current_user_can?, #current_user_has_role?, #if_can, #if_has_role, #permission_attrs, #permission_button, #permission_case, #permission_classes, #permission_field, #permission_link, #unless_can, #unless_has_role
Methods included from DashboardsHelper
#delta_badge_classes, #metric_value_classes, #render_card, #sparkline_color, #sparkline_points, #trend_direction, #trend_icon, #trend_indicator_classes
Constructor Details
#initialize(resource_class:, form:, record: nil) ⇒ FormLayoutComponent
Returns a new instance of FormLayoutComponent.
5 6 7 8 9 |
# File 'app/components/easy_admin/form_layout_component.rb', line 5 def initialize(resource_class:, form:, record: nil) @resource_class = resource_class @form = form @record = record end |
Instance Method Details
#view_template ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'app/components/easy_admin/form_layout_component.rb', line 11 def view_template has_custom = @resource_class.has_custom_form_layout? if has_custom render_custom_layout else render_default_layout end end |