• 你这里是 comment 的 edit 页面 有 project 什么事... 如果 product 的默认 url 不是 project_path 的话 要这么写

    <% form_for(@project, url: xxxx_path) do |f| %>
    ........
    <% end %>
    
  • 大会期间出租客厅 at August 01, 2013

    #3 楼 @quakewang 大神去我家吧哈 我家估计是床位不是地铺 哈哈哈~

  • 到时候给外地学生党提供床位 家里周末应该能空下 3 个床位~

  • 这种小伎俩 领证以前就察觉不出来么 这么傻的闺女

  • #42 楼 @lgn21st 晚上回到家测试了 竟然不用翻墙就能访问了...(之前只能翻墙访问的 北京长宽)

    正在 Ping ruby-china.org [122.226.207.19]
    来自 122.226.207.19 的回复: 字节=32 时间=45ms TTL=47
    来自 122.226.207.19 的回复: 字节=32 时间=40ms TTL=47
    来自 122.226.207.19 的回复: 字节=32 时间=39ms TTL=47
    来自 122.226.207.19 的回复: 字节=32 时间=42ms TTL=47
    

    真快~!

  • 目前用 Grape rails 中使用 方便快捷 不经过 rails 的各个中间件 能保证速度 配合 devise 能实现认证

  • #23 楼 @lgn21st 我确定我是北京电信 现在速度好很多了 这是最新的

    ➜  ~  ping ruby-china.org
    PING ruby-china.org (122.226.207.19): 56 data bytes
    64 bytes from 122.226.207.19: icmp_seq=0 ttl=53 time=49.254 ms
    64 bytes from 122.226.207.19: icmp_seq=1 ttl=53 time=52.363 ms
    64 bytes from 122.226.207.19: icmp_seq=2 ttl=53 time=56.384 ms
    64 bytes from 122.226.207.19: icmp_seq=3 ttl=53 time=39.276 ms
    64 bytes from 122.226.207.19: icmp_seq=4 ttl=53 time=44.358 ms
    64 bytes from 122.226.207.19: icmp_seq=5 ttl=53 time=46.349 ms
    64 bytes from 122.226.207.19: icmp_seq=6 ttl=53 time=63.238 ms
    64 bytes from 122.226.207.19: icmp_seq=7 ttl=53 time=52.263 ms
    64 bytes from 122.226.207.19: icmp_seq=8 ttl=53 time=40.441 ms
    64 bytes from 122.226.207.19: icmp_seq=9 ttl=53 time=51.920 ms
    64 bytes from 122.226.207.19: icmp_seq=10 ttl=53 time=40.861 ms
    64 bytes from 122.226.207.19: icmp_seq=11 ttl=53 time=59.417 ms
    64 bytes from 122.226.207.19: icmp_seq=12 ttl=53 time=190.448 ms
    64 bytes from 122.226.207.19: icmp_seq=13 ttl=53 time=97.913 ms
    64 bytes from 122.226.207.19: icmp_seq=14 ttl=53 time=68.068 ms
    64 bytes from 122.226.207.19: icmp_seq=15 ttl=53 time=42.260 ms
    64 bytes from 122.226.207.19: icmp_seq=16 ttl=53 time=45.893 ms
    64 bytes from 122.226.207.19: icmp_seq=17 ttl=53 time=42.302 ms
    64 bytes from 122.226.207.19: icmp_seq=18 ttl=53 time=40.078 ms
    64 bytes from 122.226.207.19: icmp_seq=19 ttl=53 time=46.532 ms
    64 bytes from 122.226.207.19: icmp_seq=20 ttl=53 time=51.478 ms
    
  • 学历低的解决之道 at July 30, 2013

    大专好像是需要工作 2 年才能报考统招研究生 这就是三本对于大专的优势... 你自考本科毕业就能考研了吧

  • #18 楼 @lgn21st

    ➜  ~  ping ruby-china.org
    PING ruby-china.org (122.226.207.19): 56 data bytes
    64 bytes from 122.226.207.19: icmp_seq=0 ttl=53 time=54.528 ms
    64 bytes from 122.226.207.19: icmp_seq=1 ttl=53 time=65.209 ms
    64 bytes from 122.226.207.19: icmp_seq=2 ttl=53 time=192.385 ms
    64 bytes from 122.226.207.19: icmp_seq=3 ttl=53 time=199.520 ms
    64 bytes from 122.226.207.19: icmp_seq=4 ttl=53 time=160.753 ms
    64 bytes from 122.226.207.19: icmp_seq=5 ttl=53 time=237.143 ms
    64 bytes from 122.226.207.19: icmp_seq=6 ttl=53 time=174.409 ms
    Request timeout for icmp_seq 7
    64 bytes from 122.226.207.19: icmp_seq=8 ttl=53 time=210.163 ms
    64 bytes from 122.226.207.19: icmp_seq=9 ttl=53 time=46.416 ms
    64 bytes from 122.226.207.19: icmp_seq=10 ttl=53 time=118.110 ms
    64 bytes from 122.226.207.19: icmp_seq=11 ttl=53 time=233.567 ms
    64 bytes from 122.226.207.19: icmp_seq=12 ttl=53 time=174.869 ms
    64 bytes from 122.226.207.19: icmp_seq=13 ttl=53 time=71.355 ms
    64 bytes from 122.226.207.19: icmp_seq=14 ttl=53 time=48.845 ms
    64 bytes from 122.226.207.19: icmp_seq=15 ttl=53 time=67.299 ms
    64 bytes from 122.226.207.19: icmp_seq=16 ttl=53 time=42.533 ms
    64 bytes from 122.226.207.19: icmp_seq=17 ttl=53 time=43.596 ms
    64 bytes from 122.226.207.19: icmp_seq=18 ttl=53 time=45.445 ms
    

    这是调整完了还是我这会儿网络通畅了... 你随意 at 我就行 或者require "base64";Base64.decode64("cXE6MTA3MTEzODky")

  • ➜  ~  ping ruby-china.org
    PING ruby-china.org (122.226.207.19): 56 data bytes
    64 bytes from 122.226.207.19: icmp_seq=0 ttl=53 time=713.489 ms
    64 bytes from 122.226.207.19: icmp_seq=1 ttl=53 time=373.933 ms
    Request timeout for icmp_seq 2
    Request timeout for icmp_seq 3
    Request timeout for icmp_seq 4
    64 bytes from 122.226.207.19: icmp_seq=5 ttl=53 time=425.872 ms
    64 bytes from 122.226.207.19: icmp_seq=6 ttl=53 time=306.721 ms
    64 bytes from 122.226.207.19: icmp_seq=7 ttl=53 time=455.477 ms
    64 bytes from 122.226.207.19: icmp_seq=8 ttl=53 time=308.195 ms
    64 bytes from 122.226.207.19: icmp_seq=9 ttl=53 time=423.455 ms
    64 bytes from 122.226.207.19: icmp_seq=10 ttl=53 time=411.260 ms
    64 bytes from 122.226.207.19: icmp_seq=11 ttl=53 time=307.603 ms
    64 bytes from 122.226.207.19: icmp_seq=12 ttl=53 time=330.481 ms
    64 bytes from 122.226.207.19: icmp_seq=13 ttl=53 time=424.613 ms
    64 bytes from 122.226.207.19: icmp_seq=14 ttl=53 time=308.058 ms
    64 bytes from 122.226.207.19: icmp_seq=15 ttl=53 time=236.329 ms
    64 bytes from 122.226.207.19: icmp_seq=16 ttl=53 time=362.687 ms
    Request timeout for icmp_seq 17
    64 bytes from 122.226.207.19: icmp_seq=18 ttl=53 time=378.833 ms
    64 bytes from 122.226.207.19: icmp_seq=19 ttl=53 time=345.922 ms
    64 bytes from 122.226.207.19: icmp_seq=20 ttl=53 time=436.009 ms
    64 bytes from 122.226.207.19: icmp_seq=21 ttl=53 time=472.898 ms
    64 bytes from 122.226.207.19: icmp_seq=22 ttl=53 time=316.221 ms
    Request timeout for icmp_seq 23
    64 bytes from 122.226.207.19: icmp_seq=24 ttl=53 time=352.678 ms
    64 bytes from 122.226.207.19: icmp_seq=25 ttl=53 time=467.004 ms
    

    我是不是要哭了 公司的北京电信

  • 不知道这个 vps 怎么样啊 之前晚上在家访问不了...只能翻墙来看... 北京长宽

  • rails js 无法解析了 at July 29, 2013

    你换了台机器用 production 启动的?还是仅仅换了个机器还是用 development 启动的

  • div
      p
        | hi
        span hi
    

    #4 楼 @kyktommy

  • a 标签里是不能再包着 a 标签的 你的最外层 link_to 也是 a 这个 a 有用么...

  • 我也来贴个结果 17l @recurlamlisp 的迭代方式 最优雅肯定妥妥的 但是效率惨不忍睹... 35 个数字就要跑 11 秒 而且全部是 CPU 100% 我自己用了个笨办法 用数组递归 跟 6l @hysios 的思路类似 虽然不优雅 但是效率很快 500 个数字 a = [];(0..500).each{|i| r= (i<2 ? i : (a[-1]+a[-2]));a.push(r)};a 不知道各位喜欢代码优雅的 还是效率更快的...

  • 真心的啊 先背下来常用的方法 也就几十个 实在不行打开 doc 在帮边查 现在工作中从来不需要补全

  • 也许用的是媳妇或者女儿的皂片~

  • rails 的设计是保存 UTC 时间 然后根据你的 local 显示不同的 local 时间 为了做倒 i18n 如果你强烈要求保存的时间就是你的 local 时间 那么请偷偷的在 application.rb 里面加上如下秘籍

    config.time_zone = 'Beijing' # or other
    config.active_record.default_timezone = :local
    config.active_record.time_zone_aware_attributes = false
    
  • 说明外国银的生活真舒适啊 有这么多时间上来回答问题@blacktulip

  • 北京的团 800 就在我们楼下哈~ 感觉办公室好小的样子... 我自己的工位这么大大的地方 团 800 能坐 3 个人...

  • pry 是可行的 irb 是不行的 但是一般遇到关键字 还是写成:class :def 这样最好...

  • #15 楼 @zfben 估计就是酱紫批量处理的场景 不过大家聊的很 high 楼主一直没粗线...

  • #13 楼 @meeasyhappy 看错了 4 楼~

  • #11 楼 @meeasyhappy 6 楼的判断会有漏洞 不只 Array 有 include?方法 字符串也有 所以必然先要 to_a 一下~

  • if params['foo'].to_a.try(:include?, 'bar') 不知道这样能不能完成你的校验...

  • 把 storage 改成本地呢?是不是 upyun 没配置好?

  • #24 楼 @w_jie 很多大牛都很喜欢帮助人啊...

  • 有个 gem 是 faye-rails 可以让你在启动 rails 的时候启动 faye 前提是开启多线程

  • #22 楼 @w_jie 嗯 晚上回家看~ 查收下邮件~ 我刚收到...