Module: Archangel::Controllers::ActionableConcern

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

Overview

Controller action concern

Instance Method Summary collapse

Instance Method Details

#actionSymbol

Controller action name as a symbol

Returns:

  • (Symbol)

    the action name


38
39
40
# File 'app/controllers/concerns/archangel/controllers/actionable_concern.rb', line 38

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


49
50
51
# File 'app/controllers/concerns/archangel/controllers/actionable_concern.rb', line 49

def collection_action?
  collection_actions.include?(action)
end

#member_action?Boolean

Test if action is a member action

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

Returns:

  • (Boolean)

    if action is a member action


60
61
62
# File 'app/controllers/concerns/archangel/controllers/actionable_concern.rb', line 60

def member_action?
  member_actions.include?(action)
end