I am trying to do a little checking before a user profile is created and
see if some fields are blank. If they, that's OK, I just need to set
them to a dummy value if they are, not blank. The reason for this is
that later on on another profile page they can change the value if the
user wants through a edit_in_place helper, but that doesn't do much good
if the fields are blank. I have this validates_each, and while the
method gets executed correctly, I need it to set some of the variables
for the User object which this method is a part of, but I am unsure on
how to do that. This is what I have tried but it doesn't work.
validates_each :company :on => :save do|record, attr, value|
value = "Click to Edit"
self.attr = value
Any sujestions? Thanks,