Name: simple-validators
Owner: Simpleweb
Description: Rails validators
Created: 2013-04-05 09:24:44.0
Updated: 2013-12-19 12:19:23.0
Pushed: 2013-12-19 12:19:21.0
Homepage: null
Size: 164
Language: Ruby
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Add this line to your application's Gemfile:
gem 'simple-validators'
And then execute:
$ bundle
To use model validations include Simple::Validators
in your model.
s User < ActiveRecord::Base
clude Simple::Validators
tr_accessible :email, :username
lidates :email, presence: true, email: true
lidates :username, presence: true, username: true
s Account < ActiveRecord::Base
clude Simple::Validators
tr_accessible :subdomain
lidates :subdomain, presence: true, uniqueness: true, subdomain: true
You can also pass a custom list of reserved subdomains, eg:
dates :subdomain, subdomain: { reserved: %w[www mail ftp home test] }
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)