Params and empty strings

Is there some better way to do this?

http://assertbuggy.blogspot.com/2007/06/ruby-on-rails-params-and-empty-strings.html

I usually use a before validate hook, and do things like:

def normalize_fields
self.foo = nil if self.foo.blank?
self.bar = nil if self.bar.blank?
end

On Wed, Mar 4, 2009 at 2:24 AM, Fresh M.
[email protected] wrote:

Is there some better way to do this?

assert_buggy: ruby on rails params and empty strings

Posted via http://www.ruby-forum.com/.


(Ruby, Rails, Random) blog: http://skandragon.blogspot.com/