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

[email protected]
深圳
186 Topics / 9147 Replies
728 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**

  • asciidoctor-htmlbook 31

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

  • material-ui 17

  • htmlrenderer 12

  • rich-text-editor 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
  • 关于 ubuntu12.04 下 wiki 中安装 rails 方法的探讨 at October 29, 2012

    #2 楼 @cxh116 可以用虚拟机。我写文章的时候是用虚拟机一边快照步进一边写的。

  • Rails 3.2 的 Ajax 向导 at October 29, 2012

    #18 楼 @reducm 又试了一下,发现可以,之前不知道搞错了什么。

  • rails tutorial 中 ajax 问题 at October 28, 2012

    #3 楼 @villins 我猜你的 destroy action 里面没有给 @user 赋值。每次访问服务都会创建新的 controller 实例,所以实例变量是不共享的。

  • 用 rvm 装 ruby 遇到的问题,求帮助 at October 27, 2012

    「具体错误我没记下来」「大体意思是现在开始给你下载 ruby 但是能不能成功」

    这谁能判断得了啊

  • 貌似 github 已经被墙了 at October 27, 2012

    可以打开浏览器调试 network,看看是什么地址不通,有时是静态文件 cdn 的服务器被封了导致打不开的。

  • Ajax in Rails at October 26, 2012

    1 楼主之前执行了 rake assets:precomplie 没有清理,相同的 js 被载入了两次,所以 ajax 请求被绑定了两次,post 了两次请求。

    解决:rake assets:clean

    2 create.js.rjs 这个文件,rjs 已经被弃用了。

    解决:删掉 create.js.rjs,新建一个 create.js.erb,内容为

    $('#cart').html('<%= escape_javascript render(@cart) %>');
    

    控制器里面加一行

    if @line_item.save
      format.html { redirect_to(store_url) } 
      format.json { render json: @line_item, status: :created, location: @line_item }
      format.js # <---------
    else
      format.html { render action: "new" }
      format.json { render json: @line_item.errors, status: :unprocessable_entity }
    end
    

    中文书版本太旧我也表示无奈,楼主要不完全照着中文书上的版本 3.0.5 联系,要不买最新版的英文电子书学习。

  • Ajax in Rails at October 26, 2012

    #4 楼 @zhaojiahui 解决了?我要完善才有时间跑起来调试

  • 请问 ruby-china 中有没有好友关注功能?? at October 26, 2012

    Twitter

  • aop 功能似乎不如 spring at October 26, 2012

    嗯嗯,楼上说的对

  • Ajax in Rails at October 26, 2012

    :remote => true 要 respond 的类型是 .js

    把项目 push 到 github 上看看你的源码。

    PS:我觉得顶楼代码没闭合啊

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

    -收回前言-

  • 这种数据是不是很适合用 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) ~

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