Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ControllerValidators
====================

Allows ActiveRecord like validations for parameter validation in your controller directly.


Example
=======

>> tv = TestValidators.new
=> #<TestValidators:0x2471434>
>> class TestValidators < ActionController::Base
>> def xx( val )
>> validate_numericality_of!( val )
>> end
>> end
=> #<TestValidators:0x246169c>
>> tv.xx( 1.0 )
=> nil
>> tv.xx( '1.0' )
=> nil
>> tv.xx( 'wes' )
VR::ControllerValidators::ValidationException: Invalid value: wes
from /Users/wes/tvapp/vendor/plugins/controller_validators/lib/vr/controller_validators.rb:104:in `validate_numericality_of!'
from (irb):14:in `xx'
from (irb):24


Copyright (c) 2010 [Wes Bailey], released under the MIT license

About

Makes common validators that are in ActiveRecord available in your controller

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages