module CmAdmin::Models::DslMethod
def bulk_action(name: nil, display_name: nil, display_if: ->(_arg) { true }, redirection_url: nil, icon_name: nil, verb: nil, display_type: nil, modal_configuration: {}, route_type: nil, partial: nil, execution_mode: :individual, &block)
- Example: Creating a bulk action -
Parameters:
-
execution_mode
(Symbol
) -- the types of execution mode are +:bulk+, +:individual+ [default +:individual+] -
partial
(String
) -- the partial path of action -
route_type
(String
) -- the route type of action, +member+, +collection+ -
modal_configuration
(Hash
) -- the configuration of modal -
display_type
(Symbol
) -- the display type of action, +:page+, +:modal+, +:button+, +:icon_only+[deprecated] -
verb
(String
) -- the verb of action, +get+, +post+, +put+, +patch+ or +delete+ -
icon_name
(String
) -- the icon name of action, follow font-awesome icon name -
redirection_url
(String
) -- the redirection url of action -
display_if
(Proc
) -- A lambda that takes the current object and return true or false -
display_name
(String
) -- the display name of action -
name
(String
) -- the name of action
def bulk_action(name: nil, display_name: nil, display_if: ->(_arg) { true }, redirection_url: nil, icon_name: nil, verb: nil, display_type: nil, modal_configuration: {}, route_type: nil, partial: nil, execution_mode: :individual, &block) bulk_action = CmAdmin::Models::BulkAction.new( name:, display_name:, display_if:, modal_configuration:, redirection_url:, icon_name:, action_type: :bulk_action, execution_mode:, verb:, display_type:, route_type:, partial:, &block ) @available_actions << bulk_action end