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

[email protected]
深圳
182 Topics / 9132 Replies
727 Followers
0 Following
11 Favorites
中下水平 Rails 程序员
Reward
GitHub Public Repos
  • writings 940

    [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**

  • 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

  • rails-app 7

    A Rails project template lets me start new projects quickly.

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 这种数据是不是很适合用 mongoDB at October 26, 2012

    很适合

  • 求教一个 slim 写 js 的问题 at October 26, 2012

    #3 楼 @nightire 少量内嵌没问题

  • 两个月前还不知道 ruby 是何物的这两周啃书表示鸭梨有点大.... at October 26, 2012

    #6 楼 @wity_lv 这本书不错的

  • 两个月前还不知道 ruby 是何物的这两周啃书表示鸭梨有点大.... at October 26, 2012

    有颠覆说明有收获

  • 擦,姐生气了,要学 ruby!自己改网站 at October 24, 2012

    哦……原来是耍花枪

  • 擦,姐生气了,要学 ruby!自己改网站 at October 24, 2012

    这什么状况

  • Agile Web Development with Rails 第四版第九章疑惑 at October 24, 2012

    @cart 一个购物车对象 @cart.line_items 购物车内的 line_item 集合 @cart.line_items.build 在购物车的 line_item 集合里面新建一个 item @cart.line_items.build(:product => product) 新建的这个 item 的参数是 :product => product

  • mongoDB collection 内的关系 at October 23, 2012

    #3 楼 @xiaoronglv counter_cache 来的,引用的时候更新。

    article 3 被哪些文章引用

    # mongoid Article.where(:reference_ids => 3)

    Page rank 那样文章本身权重再去影响引用文章得权重做不到。

  • mongoDB collection 内的关系 at October 23, 2012
    {
      _id: ...,
      title: string,
      content: text,
      reference_ids: [..., ...],
      referenced_count
    }
    
  • 求教:mongoid3 的关联查询问题?! at October 23, 2012

    #4 楼 @sforce100 其实有点不清楚你的需求,顶楼要查的是 Place,4 楼要查的是 reviews。

  • 求教:mongoid3 的关联查询问题?! at October 23, 2012

    #4 楼 @sforce100 可以,不过这个是关联方法,不是关联查询。也就是它会分成两次查询进行。

    Place.where('reviews.state' => 'published')

    这个查询针对的是 places collection,places 里面没有 reviews 数据,所以不能查。

    二楼的方法可以,会执行两次查询。如果因为性能考虑需要一次查询获得,那么就用 embed。

  • 探讨一个关于细节上设计 view 和 controller 的新手问题 at October 23, 2012

    #5 楼 @QueXuQ slim 里面应该不能这么写

    顺便

    - @projects.each do |pro|
      p = pro.name
      if pro.name == 'x'
        @tip = 1
    

    也是有问题的,正确的是

    - @projects.each do |pro|
      p = pro.name
      - if pro.name == 'x' # 或者 - @tip = 1 if pro.name
        - @tip = 1
    
  • 探讨一个关于细节上设计 view 和 controller 的新手问题 at October 23, 2012
    - if @projects.any?{|project| project.name == 'x'}
      p hello!
    
  • 为什么要嵌套 Cache at October 23, 2012

    #8 楼 @tumayun 大粒度 cache,只要有一项内容变了就整个过期,其他没变化的内容都要重新载入渲染。

  • 升级了 Ubuntu 12.10 at October 20, 2012

    #19 楼 @geekontheway 我一直推 KDE

  • 升级了 Ubuntu 12.10 at October 20, 2012

    #13 楼 @SErHo #16 楼 @Saito 注意原图在侧栏的 Download larger version (2.57 MB JPG) ~

  • 升级了 Ubuntu 12.10 at October 20, 2012

    重装 Kubuntu 12.10 了。

  • 求教:mongoid3 的关联查询问题?! at October 19, 2012

    Mongodb 没有关联查询

  • 大家看看这个代码能改进不 at October 19, 2012

    先换行吧

  • 会 Rails 的人玩 Mobile 的话选 Android 多还是 iPhone 多 at October 19, 2012

    #15 楼 @hooopo http://www.ifanr.com/176208 等你动手了……

  • 1 对多的表怎么查询比较好 at October 19, 2012

    #3 楼 @dbian 奥,关系数据库的话可以查出来。

    Book.where("created_at > ?", 1.day.ago).group(:user_id).select("user_id, count(*) AS books_count").order("books_count DESC")

  • 1 对多的表怎么查询比较好 at October 19, 2012

    依然是 count_cache,另外加 count 字段。

  • 会 Rails 的人玩 Mobile 的话选 Android 多还是 iPhone 多 at October 19, 2012

    #23 楼 @camel Java, oc, .net 均无爱

  • model 值为空,为何会报错? at October 18, 2012

    = B.first.A.try(:price)

  • rails 3.2 实现 agile web 第四版 ajax 问题 at October 18, 2012

    #10 楼 @leoRuby 09 年底接触 Rails 的。keep coding 就行了 : )

  • rails 3.2 实现 agile web 第四版 ajax 问题 at October 18, 2012

    https://github.com/leo302323/depot-with-agile-web/blob/master/app/views/line_items/create.js.erb

    前面 5 行 # 开头的代码删掉。在 erb 里面 # 不是注释,会被实际输出成 javascript 执行,然后语法错误中止

  • rails 3.2 实现 agile web 第四版 ajax 问题 at October 18, 2012

    #5 楼 @leoRuby 要看源码,干脆到 github 开个库 push 上去好了,我 pull 下来执行一下。

  • rails 3.2 实现 agile web 第四版 ajax 问题 at October 18, 2012

    页面代码贴出来一下

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