Validate a model with a session parameter


#1

Hi

I’ve set a tableless model for a contact form with this instruction:

validates_format_of :captcha,
:with =>
ActionController::SessionManagement::session[:captcha],
:message => “Security code is wrong. Please enter
it again”

Unfortunately it raises an undefinied method error; is the session
call incorrect or is it just impossible to validate such a thing ? I
don’t know how to do it directly inside the controller since
Contact.errors.add_to_base initiate to zero the errors array.

Thanks for your help