I am implementing a multi-page form and I want the user to be redirected to the same page if there is a validation error on a form, rather than the model's edit/new page. To get around this, I updated the controller action for the model so it redirects if the instance can not be saved. However, in doing so the error messages are lost - is there a way to redirect and include the generated error messages?
+1
A:
Generally while dealing with error on forms, people use to render on save errors and redirect on save success. If you render, your errors and flash will be kept.
You just have to make sure that all instance variable needed in each of your pages are set in the controller doing the render.
hellvinz
2010-10-11 14:28:52
How do I redirect and keep the errors and flash?
aaronmase
2010-10-13 08:48:27
flash is on session. Save errors in our session. DONE
shingara
2010-10-13 14:13:03