SHARE
TWEET

Untitled

a guest Feb 19th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. property :price, Float, :required => true, :format => /$?d{0,3}.{1}d{2}/
  2.    
  3. b.price = params[:price]
  4.    
  5. property :price, Float, :required => true
  6. validates_format_of :price, :with => /$?d{0,3}(.{1}d{2})?/
  7.    
  8. c = params[:price]
  9. c[0] == "$" ? b.price = c[1,7] : b.price = c
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top