I am trying to make a sign in page (in rails 3) where a modal dialog pops up (facebox) when the user clicks on a "sign in" link. I have everything working without ajax and without the modal pop up.
I'm trying to implement this by doing the following:
The part I'm stuck on is the very last part, showing the flash message and resetting the sign in page in the model pop up.
How do I do this last step?
Edit:
I understand from the comments that I need to send the flash message as json to my view and I know how to do that (json response in the controller). But how do I wire things up so I can show the flash message and reset the form in the modal without reloading the whole page?
If you are submitting form through Ajax (:remote => true) then you can send the JavaScript response from the server on validation fails. This response will display the error messages. If you have any further query then go ahead :)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.