Removing empty fields before saving

When I save data, form submits some empty (but not null) data.
How can I remove that?

Write a before_save method on your model that looks at each attribute and if it's a blank string set it to nil. I can't think of the name, but someone wrote a plugin that does exactly this.

plugin-

StripAttributes