I am redirecting from one action “receive” to other “show” using
redirect_to @post
I need to know if the visitor was redirected in the view for show
Can I store a variable @flag in receive and use it in “show” after the redirect? I couldn’t.
Is there a way to pass a parameter without showing it in the URL?
Thanks in advance.
Sounds like you should store it in the
session, maybe something like this in yourreceiveaction:Be sure to set this to
falseornilin theshowaction. Alternatively, you can check therequest.refererenvironment variable to see if it matches yourreceivepage URL, but this is perhaps less reliable than using the session.