Class: ExpressAdmin::Components::Navigation::CommandButton
- Inherits:
-
ExpressTemplates::Components::Configurable
- Object
- ExpressTemplates::Components::Configurable
- ExpressAdmin::Components::Navigation::CommandButton
- Includes:
- ExpressTemplates::Components::Capabilities::Resourceful
- Defined in:
- app/components/express_admin/command_button.rb
Instance Method Summary collapse
- #action ⇒ Object
- #button_to_options ⇒ Object
- #parent_command_button_list ⇒ Object
- #resource_name ⇒ Object
Instance Method Details
#action ⇒ Object
30 31 32 |
# File 'app/components/express_admin/command_button.rb', line 30 def action helpers.send "#{config[:command]}_#{resource_path_helper}", resource.to_param end |
#button_to_options ⇒ Object
26 27 28 |
# File 'app/components/express_admin/command_button.rb', line 26 def {remote: true, disabled: config[:disabled], confirm: config[:confirm], form_class: 'js-command-button', data: { command: command_title }} end |
#parent_command_button_list ⇒ Object
34 35 36 37 38 39 40 |
# File 'app/components/express_admin/command_button.rb', line 34 def @parent_button_list ||= parent until @parent_button_list.nil? || @parent_button_list.kind_of?(CommandButtonList) @parent_button_list = @parent_button_list.parent end return @parent_button_list end |
#resource_name ⇒ Object
22 23 24 |
# File 'app/components/express_admin/command_button.rb', line 22 def resource_name config[:resource_name] || .resource_name end |