Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
tesla_lee
@tesla_lee
会员
第 9500 位会员 / 2013-10-10

[email protected]
上海
4 篇帖子 / 92 条回帖
1 关注者
8 正在关注
118 收藏
GitHub Public Repos
  • Xin-Yue 2

    岳昕:致北大师生与北大外国语学院的一封公开信

  • threejs-miniprogram 1

    WeChat MiniProgram adapted version of Three.js

  • matrix67_pullword.rb 1

    这是根据 Matrix67 的博文,实现的一个基于大规模预料无知识库的词语挖掘算法。

  • three.js 0

    JavaScript 3D Library.

  • purgecss 0

    Remove unused CSS

  • my-emacs.d 0

    my emacs configuration

  • atom 0

    :atom: The hackable text editor

  • canyon_bunny 0

  • postcss-purgecss 0

    PostCSS plugin for purgecss

  • carrierwave-qiniu 0

    Qiniu Storage support for CarrierWave

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • 不会写前端感觉太痛苦了 at 2016年06月18日

    要是不喜欢 bootstrap,可以看看 semantic ui,或者直接 muicss。给我女朋友用的话,只要不难看就好了吧,有功能就很好了。

  • Rails MySQL String too long cause error at 2016年06月03日

    我懂你的意思了,我理解错了#5 楼 @geekjj

  • 在 Rails 项目里,redis 一般用来存哪些数据? at 2016年06月01日

    对 Redis 没有深入了解过,以前做一个文章阅读应用,我们把文章的内容放到了 Redis 里。所以可以理解为,会被经常访问到,但又不经常变化,每次查数据库开销又比较大的数据可以放到 Redis 中。Redis 应该还有其他很多用法,下面肯定还会有人补充。

  • Rails MySQL String too long cause error at 2016年06月01日

    那为什么不在 Model 里直接加一个 validate?

  • Rails number_to_human 怎么设置 xx 万的格式 at 2016年04月01日

    目前在 Rails 4.2.4 中我使用的方法,以防有人看到

    # 在Rails初始化时加入
    ActiveSupport::NumberHelper::NumberToHumanConverter::DECIMAL_UNITS[4] = :wan # 万
    ActiveSupport::NumberHelper::NumberToHumanConverter::DECIMAL_UNITS[8] = :yi  # 亿
    ActiveSupport::NumberHelper::NumberToHumanConverter::INVERTED_DECIMAL_UNITS = ActiveSupport::NumberHelper::NumberToHumanConverter::DECIMAL_UNITS.invert
    

    在 config/locales/zh.yml 文件中加入翻译

    zh:
      number:
        human:
          decimal_units:
            units:
              unit: ""
              thousand: "千"
              wan: "万"
              million: "百万"
              yi: "亿"
              billion: "十亿"
              trillion: "万亿"
              quadrillion: "千万亿"
    

    然后调用

    number_to_human(10000, locale: :zh)
    
    # "1 万"
    
    number_to_human(100000000, locale: :zh)
    
    # 1 亿
    
  • Ruby 是如何解释运行程序的 at 2015年11月17日

    谢谢,赞

  • RedisStore Cache 从 Rails 3.2.17 升级到 Rails 4.0.13 后,读取错误的问题 at 2015年07月08日

    #1 楼 @lgn21st 谢谢

  • RedisStore Cache 从 Rails 3.2.17 升级到 Rails 4.0.13 后,读取错误的问题 at 2015年07月08日

    #9 楼 @gene_wu 了解,谢谢

  • RedisStore Cache 从 Rails 3.2.17 升级到 Rails 4.0.13 后,读取错误的问题 at 2015年07月07日

    #5 楼 @rei 😄 好的,谢谢,主要就是想确认是否不兼容,如果真的不兼容。就直接清 Cache。

  • RedisStore Cache 从 Rails 3.2.17 升级到 Rails 4.0.13 后,读取错误的问题 at 2015年07月07日

    #6 楼 @hooooopo 不奇怪,主要时因为看到了下面这个方法,以为是可以兼容的,但没有找到使用方式。感谢回复 😄

    # The internals of this method changed between Rails 3.x and 4.0. This method provides the glue
    # to ensure that cache entries created under the old version still work with the new class definition.
    def convert_version_4beta1_entry!
      if defined?(@v)
        @value = @v
        remove_instance_variable(:@v)
      end
      if defined?(@c)
        @compressed = @c
        remove_instance_variable(:@c)
      end
      if defined?(@x) && @x
        @created_at ||= Time.now.to_f
        @expires_in = @x - @created_at
        remove_instance_variable(:@x)
      end
    end
    
  • RedisStore Cache 从 Rails 3.2.17 升级到 Rails 4.0.13 后,读取错误的问题 at 2015年07月07日

    #3 楼 @hooooopo #2 楼 @gene_wu 是的,清除 Cache 以后一切正常。 那是不是每次部署之前,最好都清除 Cache?这么做的原因是?

  • [上海][2015年7月14日] Ruby 聚会召集 at 2015年07月07日

    👏

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