Class: EasyAdmin::ContextMenuComponent
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- EasyAdmin::ContextMenuComponent
- Defined in:
- app/components/easy_admin/context_menu_component.rb
Instance Method Summary collapse
-
#initialize(record:, resource_class:, actions:) ⇒ ContextMenuComponent
constructor
A new instance of ContextMenuComponent.
- #view_template ⇒ Object
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 FieldsHelper
#field_component, #render_field
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(record:, resource_class:, actions:) ⇒ ContextMenuComponent
Returns a new instance of ContextMenuComponent.
3 4 5 6 7 |
# File 'app/components/easy_admin/context_menu_component.rb', line 3 def initialize(record:, resource_class:, actions:) @record = record @resource_class = resource_class @actions = actions end |
Instance Method Details
#view_template ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/components/easy_admin/context_menu_component.rb', line 9 def view_template div(class: "context-menu bg-white rounded-lg shadow-lg border border-gray-200 py-1 min-w-48") do # Default actions render_default_actions # Custom row actions if @actions.any? render_divider render_custom_actions end end end |