skip to main
|
skip to sidebar
Cutting Edge Meltdown
Rainbow road addict
Tuesday, August 4, 2009
How to validate money amount in ActiveRecord?
This is how I validate money amount in Romey.
Basically an regex that allows up to 2 decimal points or whole integers.
validates_format_of :amount, :with => /^\d+$|^\d+\.\d\d?$/
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
About Me
shenie
View my complete profile
Blog Archive
►
2011
(2)
►
June
(2)
►
2010
(2)
►
November
(1)
►
July
(1)
▼
2009
(17)
►
December
(1)
►
November
(2)
►
September
(1)
▼
August
(6)
How to stop unix read command escape backslashes
Software design or code design
Rails Rumble after thoughts
Using google_ajax_library when offline.
How to use WinMerge as ClearCase compare & merge t...
How to validate money amount in ActiveRecord?
►
April
(1)
►
February
(1)
►
January
(5)
►
2007
(3)
►
September
(2)
►
February
(1)
Labels
architecture
database
gem
git
haml
jruby
nas
qnap
rails
ruby
scripting
shell
tips
Subscribe To
Posts
Atom
Posts
Comments
Atom
Comments
No comments:
Post a Comment