返回顶部

收藏

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

相关聚客文章
  1. Alex Wood 发表 2014-10-15 13:06:29 Deploying Ruby on Rails Applications to AWS OpsWor
  2. Alex Wood 发表 2014-10-22 12:04:19 Caching the Rails Asset Pipeline with Amazon Cloud
  3. Trevor Rowe 发表 2014-11-18 19:04:17 Using Resources
  4. Trevor Rowe 发表 2014-11-20 19:04:22 Waiters
  5. Trevor Rowe 发表 2014-11-20 19:04:22 Waiters
  6. Trevor Rowe 发表 2014-11-26 19:04:20 Client Response Stubs
  7. Alex Wood 发表 2014-12-02 17:32:13 AWS re:Invent 2014 Ruby Recap
  8. Alex Wood 发表 2014-12-10 17:20:18 Using Amazon RDS with Ruby on Rails and AWS OpsWor
  9. Trevor Rowe 发表 2015-01-28 17:48:41 Upcoming Stable Release of AWS SDK for Ruby – Vers
  10. Trevor Rowe 发表 2015-02-05 23:46:12 Announcing V2 of the AWS SDK for Ruby
  11. Trevor Rowe 发表 2015-02-13 00:00:22 Amazon DynamoDB Document API in Ruby (Part 1 – Pro
  12. Trevor Rowe 发表 2015-02-18 21:28:00 Amazon DynamoDB Document API in Ruby (Part 2 – Con

发表评论