When a user submits a form and leaves certain fields blank, they get saved as blank in the DB. I would like to iterate through the params[:user] collection (for example) an
A good gem for handling this in the model: https://github.com/rmm5t/strip_attributes
It defines a before_validation hook that trims whitespaces and sets empty strings to nil.
before_validation