Ruby on Rails: Is there a way to make empty input for submit nil?

Possible duplicate:
Make empty parameters [] nil

Is there a way to make empty input for submit nil? Right now, I am looking through and in before_save manually converts everything "" to zero.

It really is not very DRY, and I feel that I am missing something.

+5
source share
2 answers
+4
source

There is no “send zero” concept in the browser.

'foo' , , params [: foo], , , .

, ?

0

All Articles