I'm completely new to rails. While learning I came across the use of the flash variable for maintaining data for the next postback when redirecting.
My questions are
when should this be used.
how does rails maintain it for me, does it make a round trip to the user and back or is it maintained server side.
Any replies would be appreciated
Your account settings have been updated! Your password or email is incorrect etc<%= flash[:whatever] %>)flash is used to store the data (generally text) which required in next request and it get deleted automatically after the next request.
flash is nothing but an object which stores in session and maintain by rails itself (server side).
Rails initialize the flash object and marked it for removal in next request so it gets deleted in next request.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With