Petr wrote:> 1) A user enters $100 into a textfield and submits, I need to strip off
> the $ sign before it gets saved to the db.
>
> 2) The name of the field is "price", why does params[:price] upon
> submitting have nil value?
1. "$100.00".scan(/[.0-9]/).to_s will return 100.00. If you
don''t want
decimal values then remove the period, but know that it will return
10000
2. You need the model in front of it. e.g.
params[:your_model_name][:price]
Hope this helps. Perhaps there is a better way to achieve number one,
but that was the quickest thing I thought of.
Regards,
Michael
--
Posted via http://www.ruby-forum.com/.