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
31 32 33 |
# File 'app/components/express_admin/command_button.rb', line 31 def action helpers.send "#{config[:command]}_#{resource_path_helper}", resource.to_param end |
#button_to_options ⇒ Object
25 26 27 28 29 |
# File 'app/components/express_admin/command_button.rb', line 25 def = {} = { data: { confirm: config[:confirm] } } if config[:confirm] .merge({ disabled: config[:disabled] }) end |
#parent_command_button_list ⇒ Object
35 36 37 38 39 40 41 |
# File 'app/components/express_admin/command_button.rb', line 35 def ||= parent until .nil? || .kind_of?(CommandButtonList) = .parent end return end |
#resource_name ⇒ Object
21 22 23 |
# File 'app/components/express_admin/command_button.rb', line 21 def resource_name config[:resource_name] || .resource_name end |