I wish to set my session variables to null when click on a link of my
Rails website. My major problem is this: when I click on a link and
then return to the previous view, my session variables still remain,
unless I click on a cleaning button where I set my variables to null
(nil) (via a method called action, set in the forms)
This is a problem when dealing with a lot of users. I type something
on a text field and when I click on the submit button, it saves on a
session variable and then it shows on the field as a preset value.
Then I click on a link of my website, and I suddenly have the idea of
returning to my previous view, via click a link. And instead of
erasing the value, it’s still there. Unless I click on another button
to erase the value of the session variable, It’s impossible to erase
it when going somewhere else.
I need help here. How do I clean those variables in that case? (When I
click to another link, not a button.)
An example of what I’m talking about is this: session[:variable]. I
can’t erase it.