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 Mix
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:>
> Is there some better way to do this?
>
>
http://assertbuggy.blogspot.com/2007/06/ruby-on-rails-params-and-empty-strings.html
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>
--
(Ruby, Rails, Random) blog: http://skandragon.blogspot.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---