开发者

Rails: Empty fields are creating the string 'undefined' in database

For some reason when users are skipping optional fields signing up, the database is filled with the string 'undefined' instead of NULL or a blank string.

I am using Rails 2.3.4 and MySQL.

Is this a known bug/issue for earlier versions of Rails?

Thank yo开发者_如何学Cu,

Eric


Add a :default option in the field of your schema to what you want

:default => null

or

:default => ""

Will work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜