Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- property :price, Float, :required => true, :format => /$?d{0,3}.{1}d{2}/
- b.price = params[:price]
- property :price, Float, :required => true
- validates_format_of :price, :with => /$?d{0,3}(.{1}d{2})?/
- c = params[:price]
- c[0] == "$" ? b.price = c[1,7] : b.price = c
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement