0

I my project I am having varible

id=params[:id]
status=params[:status]
.....

if(!status.nil?)
   if(status='off')
   flag[id]=1
   else
   flag[id]=2
   end
else
   if(flag==1)
    puts off
   else
    puts on
end
  • request come with status depending on status I am creating flag

  • i want to use that flag in next call to the function when the status is nil

  • My problem is that I am not getting the flag values in next call

  • How to temporary store that values for later use

1 Answer 1

3

If you want to keep a value between requests, using sessions is probably the right way to do it. See this guide for more on the topic.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.