Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
vincent178
@vincent178
Member
NO. 5347 / 2013-01-18

[email protected]
24 Topics / 223 Replies
5 Followers
7 Following
40 Favorites
GitHub Public Repos
  • nvim-github-link 8

    GithubLink is a Neovim plugin that generates Github links for the current line or selection in yo...

  • dotfiles 6

    mine configurations

  • csapp 1

  • ratelimit 1

    Go/gRPC service designed to enable generic rate limit scenarios from different types of applicati...

  • xlsx2csv 1

    convert xlsv to csv

  • go-mysql 1

    a powerful mysql toolset with Go

  • vincent178.github.io 1

  • messenger 1

  • shining-csv 1

  • di 1

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • Rails 简单页面浏览量计数器的问题 at January 30, 2013

    #4 楼 @WilliamZhu 嗯,谢谢你的建议。你看这段代码可以怎样改进呢?

  • Rails 简单页面浏览量计数器的问题 at January 30, 2013

    #1 楼 @shawnyu 搞定啦,万分感谢。现在 view! 方法是这样的

    def view!
      if self.viewed_count.nil?
        self.viewed_count = 1
        self.save
      else
        self.viewed_count += 1
        self.save
      end
    end
    
  • Rails 简单页面浏览量计数器的问题 at January 30, 2013

    #1 楼 @shawnyu 在 model 里面吗?之前却是没有调用, = =,我刚试了一下,会产生这样的错误

    undefined method `save' for 1:Fixnum
    

    我想应该是 viewed_count 的值为 1 了,没有 save 的方法~

  • 求 rails 入门级别教程!小弟拜谢了 at January 29, 2013

    Learn Web Development with the Ruby on Rails Tutorial,这本书不错哦

  • 下周二 (2 月 5 日) 晚上 网上现场 coding 第二季 (入场中...) at January 29, 2013

    已经报名~,^ ^

  • Prev
  • 1
  • 2
  • …
  • 6
  • 7
  • 8
关于 / RubyConf / Ruby 镜像 / RubyGems 镜像 / 活跃会员 / 组织 / API / 贡献者
由众多爱好者共同维护的 Ruby 中文社区,本站使用 Homeland 构建,并采用 Docker 部署。
服务器由 赞助 CDN 由 赞助
iOS 客户端 / Android 客户端 简体中文 / English