Module: Archangel::Helpers::ActionableConcern

Extended by:
ActiveSupport::Concern
Included in:
BackendController
Defined in:
app/controllers/concerns/archangel/helpers/actionable_concern.rb

Overview

Helper action concern

Instance Method Summary collapse

Instance Method Details

#actionSymbol

Controller action name as a symbol

Returns:

  • (Symbol)

    the action name



35
36
37
# File 'app/controllers/concerns/archangel/helpers/actionable_concern.rb', line 35

def action
  action_name.to_sym
end

#collection_action?Boolean

Test if action is a collection action

Actions include [:index]

Returns:

  • (Boolean)

    if action is a collection action



46
47
48
# File 'app/controllers/concerns/archangel/helpers/actionable_concern.rb', line 46

def collection_action?
  collection_actions.include?(action)
end

#member_action?Boolean

Test if action is a member action

Actions include [:show, :edit, :update]

Returns:

  • (Boolean)

    if action is a member action



57
58
59
# File 'app/controllers/concerns/archangel/helpers/actionable_concern.rb', line 57

def member_action?
  member_actions.include?(action)
end