Removing empty fields before saving


#1

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

Thanks.


#2

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.


#3

plugin-

StripAttributes