Rails 在 Session 中存放数据

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

class HelloController < ApplicationController
  def there
    @counter1 = 1

    if(session[:counter2])
      @counter2 = session[:counter2]
      @counter2 += 1
      session[:counter2] = @counter2
    else
      @counter2 = 1
      session[:counter2] = @counter2
    end
  end
end