Module: ActionController::Base::WhitelistControllerActions

Defined in:
lib/vex/action_controller/whitelisted_actions.rb

Instance Method Summary collapse

Instance Method Details

#verify_whitelisted_actionsObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/vex/action_controller/whitelisted_actions.rb', line 12

def verify_whitelisted_actions
  return if self.class.name.starts_with?("Clearance::")

  valid_actions = self.class.whitelisted_actions
  return if valid_actions == :skip || valid_actions.include?(action_name)

  unless Rails.env.development?
    error 404, "This page doesn't exist"
    return
  end

  error 404, <<-TEXT
No such action exists: #{controller_name}##{action_name}.
Note: this application uses the whitelisted_actions plugin,
you might have to use the 'actions' method to whitelist your actions.
TEXT
end