What did I do :)? In rails form has f.error_messages alwais empty. How can I fix/check this?
Thx
What did I do :)? In rails form has f.error_messages alwais empty. How can
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The AR#validate method fills the model’s error hash with validation errors.
If between instantiating the model and the call f.error_messages you do not call validate (via AR#save or directly) the @errors hash never gets filled and the errors are never shown).
Also make sure you do not redirect ( the validated object gets lost and a new one is created and has no “filled” @errors hash ), but call
render :action => ...