Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
Rei
@Rei
管理员
第 1 位会员 / 2011-10-28

[email protected]
深圳
182 篇帖子 / 9132 条回帖
727 关注者
0 正在关注
11 收藏
中下水平 Rails 程序员
打赏作者
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
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • 大家好,问一个 Ruby 的基础问题。 at 2015年08月22日

    发代码不要用截图。

  • 请教更简洁的写法 at 2015年08月21日
    class User
      has_many :memberships
      has_many :circles, through: :memberships do
        # Association Extensions
        def status(status)
          where(memberships: { status: status })
        end
      end
    end
    
    class Membership
      belongs_to :user
      belongs_to :circles
    end
    
    class Circle
      has_many :memberships
      has_many :users, through: :memberships
    end
    
    # Association
    User.first.circles.where(memberships: { status: status})
    # Association Extensions
    User.first.circles.status(status)
    
  • 请教更简洁的写法 at 2015年08月21日
    Circle.joins(:memberships).where(memberships: { status: status, user_id: id })
    
  • [广州] (外资) 诺特软件 诚招 Ruby 技术顾问 1 人,Ruby 开发工程师 3 人 at 2015年08月21日

    #2 楼 @gztheknot pass

  • [广州] (外资) 诺特软件 诚招 Ruby 技术顾问 1 人,Ruby 开发工程师 3 人 at 2015年08月21日

    https://ruby-china.org/topics/25579

    请不要包含如“公司美女如云”等不符合技术社区价值观的内容,如果发布类似“急招 Ruby 程序员,QQ 号 xxxxx”这样的马路小广告式的招聘贴,见一个,删一个,决不姑息!

  • 使用 4.2 的 active_job 和 Sidekiq,但是不工作 at 2015年08月20日

    启动了 worker 没?

  • Ruby 2.2.2 使用中的问题 at 2015年08月18日

    有啊 http://ruby-doc.org/stdlib-2.2.2/libdoc/securerandom/rdoc/SecureRandom.html

  • 求助 ,上传照片出现 RequestURITooLarge 错误 at 2015年08月17日

    #4 楼 @liguangsong 可能默认加载的 jquery-ujs 被去掉了,看看 application.js

    https://github.com/rails/jquery-ujs

  • 求助 ,上传照片出现 RequestURITooLarge 错误 at 2015年08月17日

    用 POST

  • 前方有坑,请注意。。。 蛋疼的 first_or_create at 2015年08月16日

    #16 楼 @zhangjinzhu 我第一时间看不懂,以为 SELECT 语句是对应最后一行代码。

    调试了一下,似乎 find_or_create 语法没有这个问题。试试:

    order.items.find_or_create_by(product_id: 888)
    
  • 前方有坑,请注意。。。 蛋疼的 first_or_create at 2015年08月16日

    看起来是同一个问题 https://github.com/rails/rails/issues/9894

  • 前方有坑,请注意。。。 蛋疼的 first_or_create at 2015年08月16日

    这就是不好好说话,浪费双方时间的例子。

    顶楼意思是:

    item = order.items.where(product_id: 888).first_or_create
    
    # 在 item 的回调中
    order.items
    # => SELECT `order_items`.* FROM `order_items` WHERE `order_items`.`product_id` = 888 AND `order_items`.`order_id` = 99
    # 多了一个 product_id
    
  • 前方有坑,请注意。。。 蛋疼的 first_or_create at 2015年08月16日

    问题在哪?

  • 求助:rails 使用 link_to 跳转到目的页面后 jquery 的 ready 函数不起作用,必须刷新页面才行 at 2015年08月15日

    http://guides.ruby-china.org/working_with_javascript_in_rails.html#turbolinks

  • Rails4 + Carrierwave 下實現 JSON 形式的文件上傳 API at 2015年08月15日

    文件全部读入内存,内存很容易耗光吧。

  • 分享 (Ruby Web 服务器这十五年) at 2015年08月14日

    #2 楼 @lgn21st 是指链接

  • 请教一个关于 data-remote 调用的 view 的问题 at 2015年08月14日

    #5 楼 @liwei78 唤醒了我远古的记忆,浮现了一点片段,马上又被掩埋……

  • Rails Girls Shenzhen 视频 at 2015年08月14日

    #6 楼 @jobthoughtworks 你们会在招聘信息里面写“99% 的妹子是想搭讪你,只有剩下 1% 才真的只想学写代码”吗?

  • Rails Girls Shenzhen 视频 at 2015年08月14日

    #5 楼 @jobthoughtworks

    拉赞助不是错,为了赞助丢失立场是错。

    我那篇整理已经一次性把问题和建议说清楚了,避免无限上纲,我以为这是诚意,但是 Coding 此后就不承认不回应了。

    主观上没有歧视意图,但是说了歧视性言论,也要为自己的言行负责。及时承担责任就能得到谅解,推脱只会被摈弃。

    我赞同在需要公平对待的时候不给女性优惠,同时提供前期免费培训是很好的履行男女平等。

  • 请教一个关于 data-remote 调用的 view 的问题 at 2015年08月14日

    #3 楼 @aswong83 <a> 没有 link_to 这个属性,可能你自己绑定了逻辑?

    /xxx/yyy 经过路由,找到对应的 action,然后根据 action 调用模版。因为是 ajax 请求,所以它默认是找 .js.erb 类型的模版,跟 .html.erb 没有必然关系。还是要再看看官方文档

    http://guides.ruby-china.org/working_with_javascript_in_rails.html#%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%AB%AF%E5%A4%84%E7%90%86 https://github.com/rails/jquery-ujs

  • 请教一个关于 data-remote 调用的 view 的问题 at 2015年08月14日

    你理解有误:

    1. 下划线开头的模版是局部模版,可以用于抽取共用的页面模版或者 ajax 返回替换。
    2. data-remote 会发起 rails_ujs 形式的 ajax 请求,但返回什么取决于服务端逻辑,跟局部模版没有必然关联。
    3. rails_ujs 目前不支持区分鼠标左键和右键,需要自己实现客户端代码。
  • 差点被骗,原来邮箱密码暴露……细思恐极…… 对方还在不断登录我邮箱修改我亚马逊密码……还锲而不舍地给我打电话! at 2015年08月14日

    国内不少邮件“大厂”连 https 都没有默认开启。

    要安全用 Gmail + 两步验证。

  • Rails Girls Shenzhen 视频 at 2015年08月14日

    虽然你分享了大段经历,但都没有进入问题核心:

    1. RG China ^1 如何看待 Coding 那篇文章。
    2. RG China 如何对待 Coding 违反 Rails Girls 宗旨的言论。

    ^1 RG China 指这次活动拿了 Coding 赞助的人或组织。

    距离文章遭到抗议已经一周了,其间 Coding 再无声音,采取了不承认、不回应的行动。sundevilyang 隔了这么久才首次发声,并且希望大家在 Coding 连错误都不承认的情况下包容它。

    我很失望,Rails Girls 活动要在包容 Coding 那篇文章的情况下进行了,而喋喋不休的我成了那个不会看气氛的人。

  • 数据迁移和模型里面 validate 区别 at 2015年08月13日

    4 https://github.com/rubygems/rubygems.org

  • d at 2015年08月13日

    #4 楼 @booobstar 我现在才看懂问题,意思是配置文件里没有这些配置,但是 PATH 还是加载进来了?

    不清楚了,很久不用 rvm。

  • d at 2015年08月13日

    #2 楼 @booobstar 那这个脚本可以做很多事。

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