Module: ActionController::VerifyAction

Included in:
Base
Defined in:
lib/vex/action_controller/verify_action.rb

Overview

This module adds/modifies ActionController::Verification. It adds

  • adds verify? and verify, which verifies conditions on a per action base. On error the former returns false, while the latter raises an exception.

  • adds improved error messages

Defined Under Namespace

Classes: Error

Class Method Summary collapse

Class Method Details

.fail(options, better_msg = nil) ⇒ Object

Raises:



11
12
13
14
15
16
# File 'lib/vex/action_controller/verify_action.rb', line 11

def self.fail(options, better_msg=nil)
  msg = "Action verification failed: #{options.inspect}"
  msg += " #{better_msg}" if better_msg
  
  raise Error, "#{msg}."
end