save it in the session hash on validation and delete it from the session
hash after the save.
if validations fails, try to find the value on the session and putting it in
the controller. Since validation will trigger again
in a second submit, also look for the value in the session hash before
setting a new one.


validate do |applicant|
 applicant.check_things
  if session[:mysterous_object].nil?
    applicant.non_represented_field = session[:mysterous_object] =
123456789
  else
    applicant.non_represented_field = session[:mysterous_object]
  end
end


then on an after save

session[:mysterous_object] = nil

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to