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

4

1 回答 1

3

如果您想在请求之间保留一个值,使用会话可能是正确的方法。有关该主题的更多信息,请参阅本指南

于 2012-09-11T10:55:49.590 回答