Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Makes common validators that are in ActiveRecord available in your controller
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib/vr
tasks
test
MIT-LICENSE
README
Rakefile
init.rb
install.rb
uninstall.rb

README

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
Something went wrong with that request. Please try again.