Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
Rei
@Rei
Admin
NO. 1 / 2011-10-28

[email protected]
深圳
188 Topics / 9155 Replies
730 Followers
0 Following
11 Favorites
中下水平 Rails 程序员
Reward
GitHub Public Repos
  • writings 941

    [Closed] Source code of writings.io

  • alipay 732

    Unofficial alipay ruby gem

  • code_campo 291

    [Closed] Source code of http://codecampo.com

  • asciidoctor-pdf-cjk-ka... 101

    **no longer maintained**

  • geeknote 34

  • asciidoctor-htmlbook 31

    Asciidoctor HTMLBook is an Asciidoctor backend for converting AsciiDoc documents to HTMLBook docu...

  • material-ui 17

  • rich-text-editor 12

  • htmlrenderer 12

  • rails-chatgpt-demo 8

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 为什么,以及如何学习 Basecamp 架构 at January 23, 2014

    #4 楼 @zisasign 你记混了吧

    Code statistics for Basecamp Next

    http://37signals.com/svn/posts/3094-code-statistics-for-basecamp-next

    I get paid for code that works, not for tests, so my philosophy is to test as little as possible to reach a given level of confidence (I suspect this level of confidence is high compared to industry standards, but that could just be hubris).

    是 TDD 创始人 Kent Beck 说的,而且别脱离上下文理解: http://stackoverflow.com/questions/153234/how-deep-are-your-unit-tests

    如果只看只言片语就“奥!Kent Beck 叫我们不要测试!”,那么以后都跟优秀开发者无缘了。

  • yield 肿么翻译 at January 23, 2014
    1. 耶!
    2. 阉!
  • 为什么,以及如何学习 Basecamp 架构 at January 23, 2014

    #1 楼 @bhuztez 举两个例子:

    1 SJR

    SJR 难以调试、不充分利用客户端资源、无法应对大网站

    但 Basecamp 就是这么做的

    2 Turbolinks

    Turbolinks 破坏了我的小脚本,跟前端框架配合不好

    但 Basecamp 就是这么做的


    Update: 换了个更合适的标题

  • 为什么,以及如何学习 Basecamp 架构 at January 23, 2014

    #1 楼 @bhuztez 相关资料那里已经分享得差不多了,这篇目的是推荐大家亲眼看看 Basecamp 实际上是不是这样做的。

  • ajax 后如何调用 coffeescript 里面的变量或者方法? at January 23, 2014

    coffeescript 默认编译出来带一个匿名域,无法在全局域访问里面的方法。虽然可以关掉 coffeescript 这个功能,但更好的方案是明确把要暴露的方法放到全局:

    window.map = ->
    
    # or
    
    youApp.map = ->
    
  • The Rails Way? at January 23, 2014

    The Rails Way 要看 Basecamp

  • 通过 iframe 中的元素获得其父级 document . at January 23, 2014

    从 star 数看 at.js 已经是流行项目了啊

  • 你选择 Angular 还是 Ember? at January 23, 2014

    #49 楼 @yuh http://backbonejs.org/#examples 这个列表依然给我强劲的信心

  • Rails check_box 的疑问 at January 23, 2014

    #5 楼 @joezhang Try direct assignment in console.

  • 共享下普迅短信后台的 gem at January 22, 2014

    #5 楼 @wikimo 不用英文文档,我会认为作者没有做好长期维护、并且面向整个社区的准备,我会选有英文文档的替代品。

  • 共享下普迅短信后台的 gem at January 22, 2014

    赞!

    提点建议:

    1. tab 统一为两个空格
    2. 用英文写文档,开放给整个开源社区
  • Rails check_box 的疑问 at January 22, 2014

    比较奇怪,默认应该就是转化为 true/false 的。

  • 你选择 Angular 还是 Ember? at January 22, 2014

    我两个文档都啃了两次,动手的时候发现一个问题:为什么要把一个应用拆成两个徒增代码量,所有变量传递都改成 API?

    后来 DHH 写了 SJR 那篇文章(http://37signals.com/svn/posts/3697-server-generated-javascript-responses),我发现 Basecamp 方案就是我要的。

  • 关于招聘的一些感触 at January 21, 2014

    #44 楼 @cassiuschen 这篇文章的意思是,在有的语言好的实践放在另一个语言可能是坏实践。融会贯通有好也有坏,把一个语言的经验不能照搬到另一个。DHH 这样的程序员选择精通一个,而不是做语言大师。

    说得通俗的就是,不要浑身是刀,没一把锋利。

  • 关于招聘的一些感触 at January 21, 2014

    #40 楼 @cassiuschen

    That's the real point here: Be careful with who you share your intellectual foundation with. It's fashionable to say "I'm not a Ruby programmer, I'm just a programmer". But languages shape the way we think. While we can cross-pollinate some ideas between languages, there are many we cannot. And worse, the incompatibility is not immediately apparent — especially when they both seem to just be Objective Oriented.

    I'm a Ruby programmer. —— By David Heinemeier Hansson on Jan 6, 2013 http://david.heinemeierhansson.com/2012/dependency-injection-is-not-a-virtue.html

  • 搞不懂关联表之间要怎么对不是主键的数据进行操作 at January 21, 2014

    #11 楼 @satoshigi 从数据管理角度,这是两个物品了。一般电商网站会保留所有商品信息和订单信息,商品条目只会软删除,你需要的 prize 表,比较像订单。

  • rails 范围查找函数有吗 (已解决) at January 21, 2014
    LEVEL_TABLE = [100, 200, 500]
    
    def level
      LEVEL_TABLE.index { |exp| exp > self.exp }
    end
    
  • 搞不懂关联表之间要怎么对不是主键的数据进行操作 at January 21, 2014

    #9 楼 @satoshigi 我觉得礼物的 id 是不变的啊,比如有 ID 为 1~10 的物品,今天允许选 1~6,明天允许选 5~9,但是礼物的 id 没变啊。

  • 搞不懂关联表之间要怎么对不是主键的数据进行操作 at January 21, 2014

    #7 楼 @satoshigi 意思是顶楼的 prize 表已经是关联表吗?补充一些详细的业务描述和数据描述,现在看不明白,为什么 prize 表里面同时有 id 和 prize_id,prize_id 指向哪?

  • 搞不懂关联表之间要怎么对不是主键的数据进行操作 at January 21, 2014

    #5 楼 @satoshigi 多对多关联,has_and_belongs_to_many,prize 表只要 name 和 id,再加一个关联表 users_prizes ( user_id, prize_id ),users 表也去掉 prize_id。

  • 搞不懂关联表之间要怎么对不是主键的数据进行操作 at January 21, 2014

    #3 楼 @satoshigi 别说你想查什么(代码层),说你想做什么(业务层)。

  • 搞不懂关联表之间要怎么对不是主键的数据进行操作 at January 21, 2014

    这特么是个多对多关联吧,看 has_and_belongs_to_many

    http://guides.rubyonrails.org/association_basics.html#the-has-and-belongs-to-many-association

  • 搞不懂关联表之间要怎么对不是主键的数据进行操作 at January 21, 2014
    class User
      belongs_to :prize, primary_key: 'prize_id'
    end
    

    隐约觉得是个 X-Y 问题,楼主你原本想干嘛?

  • rails 范围查找函数有吗 (已解决) at January 21, 2014

    应该是这个意思

    def level
      if exp > 100
        1
      elsif exp > 200
        2
      elsif exp > 500
        3
      end
    end
    

    求简化。

  • 丢帖子了么? at January 21, 2014

    已恢复。

  • 丢帖子了么? at January 21, 2014

    #3 楼 @luliangshu 你要考虑回答问题的人的心情啊,劳动成功被消除了。以后别人遇到同样问题的也可以搜进来,不犯同样错误。

    如果你同意我可以恢复帖子。

  • 丢帖子了么? at January 21, 2014

    楼主自己删了 @luliangshu

  • 请问在 model test 中的 assert_equal 是否支持中文 at January 20, 2014

    product.errors[:price] 应该是个数组。

    一般测 assert product.invalid? 就够了。

  • 别用 CoffeeScript 了,你总有一天得学 JavaScript at January 20, 2014

    #36 楼 @jeff_duan 我前阵子才留意到的:coffee-script、backbone、underscore 的作者是同一人

    https://github.com/jashkenas?tab=repositories

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