Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make flash() available on same request? #27

Closed
jeroenbourgois opened this issue Mar 14, 2012 · 1 comment
Closed

make flash() available on same request? #27

jeroenbourgois opened this issue Mar 14, 2012 · 1 comment

Comments

@jeroenbourgois
Copy link

I am having trouble using the flash().

I have a form, and in the POST route dispatch function, I validate the form. If it is invalid, I call flash() and render my view, but first the flash_now() is empty (as stated in the readme, I know).

But isn't it usefull to have it right away? Because now I need to set('error', 'some_message') instead,

@16
Copy link
Collaborator

16 commented Apr 14, 2012

flash() is made to pass messages between pages. It works like the flash in RoR

The flash is a special part of the session which is cleared with each request. This means that values stored there will only be available in the next request, which is useful for storing error messages etc.

If you just need to display something on your view, using set is the right thing to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants