I'm using a regex to validate a form field in my sinatra app that's being sent to my db using the data_mapper gem. The code I'm using for the field in my model is:
property :price, Float, :required => true, :format => /\$?\d{0,3}\.{1}\d{2}/
And it's being saved from the params:
b.price = params[:price]
I keep getting an invalid format error when I try to save, though. I checked my regex with rubular and it seems to be working correctly. Anyone have any idea what's going wrong?