Number input field (stuck with whitespaces)

All,

I am RoR newbee, so maybe this is stupid question, but I can't figure it out. I have a form from which I want to get some numbers. But if user has typed a number with whitespaces in it, I am getting only the first part until the whitespace.

For example, if user types 300 000, the record is saved as only 300.

Can anybody help?