返回顶部

收藏

Rails 在 Session 中存放数据

更多
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

标签:ruby

收藏

0人收藏

支持

0

反对

0

发表评论