Hi...
Got a quick question about a before_filter routine I''m setting up in
Rails
I''m a RoR newbie coming from the PHP world and I normally
"clean" POSTed
input from forms by looping through the form submission and setting any
blank strings to NULL for database processing.
I''m trying to do something similiar in Rails with the following
before_filter in my "PeopleController"
before_filter params[:person].delete_if { |key, value| value == "" }
if
@params
This (and the multiple permutations that I''ve tried) doesn''t
seem to be
working, which is having the side effect of tripping any of my
validations that are set to :allow_nil
I guess I''m missing something simple because my eyes are now crossed
re-working this line of code so many times.
Any suggestions? Thanks
Chris
--
Posted via http://www.ruby-forum.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
-~----------~----~----~----~------~----~------~--~---