Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
刘二狗
@coderliu
Member
NO. 23873 / 2015-12-07

[email protected]
厦门
2 Topics / 139 Replies
7 Followers
30 Following
62 Favorites
GitHub Public Repos
  • iOSAnimationSample 12

    iOS animation samples from JakeLin's Swift lesson

  • Todo 2

    Swift Todo from JakeLin's lesson

  • coderliu 0

  • rubocop 0

    A Ruby static code analyzer and formatter, based on the community Ruby style guide.

  • ai-meeting-digest 0

    A full-stack Rails web application with Hotwire that allows a user to submit a raw meeting transc...

  • rubygems.org 0

    The Ruby community's gem hosting service.

  • homeland 0

    :circus_tent: Open source discussion website.

  • capistrano-sneakers 0

    Sneakers support for Capistrano

  • rms-support-letter.git... 0

    An open letter in support of Richard Matthew Stallman being reinstated by the Free Software Found...

  • graphql.github.io 0

    GraphQL Documentation at graphql.org

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 请问如何写成下面这个 json 的 API? at August 07, 2018

    5 楼贴的代码只是依据你贴的格式最直观的生成方式,易于理解但是性能上不理想,在循环里有数据库查询,真要这么用最好加个缓存,性能上比较理想的实现还是一次性都取出来再构建 JSON

  • 南京的 Rubyist/Railser 在哪里啊 at August 07, 2018

    Rubyist 已经够少了,还分裂出 Railser 真的好吗😂

  • 请问如何写成下面这个 json 的 API? at August 07, 2018
    @categories = Category.all
    result = { 
      data: @categories.map do |category|
        {
          id: category.id,
          product_category: category.product_category,
          item: category.products.map do |sub_category|
            { product_name: sub_category.product_category }
          end
        }
      end
    }
    render json: result
    

    不用 AMS 或者 JBuilder 的话可以这样。理解了这个 map 怎么写,AMS 用起来也就不难了

  • 求助:rails 中使用 kindeditor 富文本编辑器网络上传没问题,本地上传错误 at August 06, 2018

    froala 应该是收费的

  • [上海] 悦勤信息 2018 夏秋季:诚聘 Ruby/JavaScript 手艺人 (从兼职开始) at July 25, 2018

    节约成本不用 Mac,为什么不选择 Linux 呢?😮

  • A has_many B, 如何在 A show page 创建 B at July 05, 2018
    # routes.rb
    # resource :servers, module: 'servers' do
    #   resources :vms
    # end
    
    #app/controllers/servers/vms_controller.rb
    class Servers::VmsController < ApplicationController
      # POST /servers/:id/vms
      def create
        @server.vms.build(vm_params)
      end
    end
    

    How DHH Organizes His Rails Controllers

  • [上海] DiningCity 招聘 Ruby on Rails 应用开发 Ruby Programmer 坐标:徐家汇 at June 28, 2018

    发现一个 bug

  • [北京] 购够网络科技有限公司 招聘 Rails 工程师 (10K-15K) at June 27, 2018

    这种雇主管理员不考虑封禁一下?

  • 存储网络图片 at June 15, 2018

    如果你用的是 Carrierwave 假设 cover 是你 mount 的字段

    @book.update(remote_cover_url: 'http://fake.img/123.png')
    
  • [深圳] 2018-06-30 Ruby 技术交流活动 [活动报名] at June 07, 2018

    😍 已报名,期待

  • RubyMine 中创建 Rails 项目,如何使用 db2 数据库? at May 16, 2018

    rails db2

  • 这两种中断 redirect_to 的方式有区别吗 at May 14, 2018

    三

    redirect_to root_url
    return
    

    和上面两种也是等价的

  • 求推荐用 rails 做后端 api 开发的教程 at May 03, 2018

    https://rails.guide/book/api_app.html#using-rails-for-api-only-applications

    这个可以结合着看一下,1 楼的帖子是在还没有 API only 模式时写的了,但是还是有很多值得参考的信息

  • Rails 的欢迎页面改了 :laughing: at April 27, 2018

    😂 已经有人提 issue 要求把🐶加回来了 https://github.com/rails/rails/issues/32742

  • Rails 的欢迎页面改了 :laughing: at April 27, 2018

    😤 搞政治正确我无所谓,但是欺负狗党无法忍受(诶,我在 RubyChina 头像怎么是只猫

  • 一个 muse 教学案例的分享 (包含:功能 + 用户 + 设计 + 投票 + 部署) at March 28, 2018

    能不能把这个把论坛当垃圾桶的给封了🙄

  • 地道厦门人,2018 找个职位安家. at February 27, 2018

    😂 2 年 Rails 经验新厦门人搭车求厦门或远程职位,有意私信或邮箱 [email protected] 联系我

  • [深圳][后端实习] BellCode 2018 后端工程师实习招聘 at February 27, 2018

    简历投递 (麻烦注明来自 V2EX)

    RubyChina 哭了😂

    刚刚在 100offer 投了你们的职位😀

  • Rails 问题求教,关于数据模型 at January 19, 2018

    annotate +1

  • Active Record 的问题 at January 19, 2018

    controller 里的查询不论搜索条件如何都应该用相同的查找方法(例如 where),保证查询结果是 ActiveRecord_Relation 或数组

  • 厦门豪米房产代理有限公司诚邀 2 名 Ruby 开发实习工程师 at January 19, 2018

    已经加了 1208201771 这个 QQ 对应的微信号的好友😀

  • 厦门豪米房产代理有限公司诚邀 2 名 Ruby 开发实习工程师 at January 19, 2018

    两年 Rails 经验的有兴趣聊一聊吗?

  • 关于 Rails 的时区问题 at January 11, 2018

    数据库里存的是 GMT,你 Page.last.created_at 读出来会发现它又加上 8 小时变成 12 点了

    你可以看看你的数据库设置的时区是哪个,可以试试看把时区改成东八区之后存进去的 SQL 会变成怎样

  • 权限设计 - Role-based Authorization with Pundit at January 09, 2018

    刚刚照这篇文章在 ActiveAdmin 做的后台里实现了 RBAC 权限管理,感谢😉 😉

  • 『编程项目赚了两千万』,这些人的良心不会痛吗? at December 29, 2017

    他们根本没有良心

  • 查询了 16W 数据,加载很慢,希望大家有时间帮忙看一看 at November 07, 2017

    这个随机放到数据库层面来做就好了吧

    # One record
      Corpus.order('rand()').take
    # Array
      Corpus.order('rand()').limit(1)
    
  • 10 月 30 号下一个月是哪天?10 月 30 号下一个月上一个月是哪天? at November 02, 2017
    # Returns a date object pointing n months after self. The argument n should be a numeric value.
    
    Date.new(2001,2,3)  >>  1   #=> #<Date: 2001-03-03 ...>
    Date.new(2001,2,3)  >> -2   #=> #<Date: 2000-12-03 ...>
    
    #When the same day does not exist for the corresponding month, the last day of the month is used instead:
    
    Date.new(2001,1,28) >> 1   #=> #<Date: 2001-02-28 ...>
    Date.new(2001,1,31) >> 1   #=> #<Date: 2001-02-28 ...>
    
    #This also results in the following, possibly unexpected, behavior:
    
    Date.new(2001,1,31) >> 2         #=> #<Date: 2001-03-31 ...>
    Date.new(2001,1,31) >> 1 >> 1    #=> #<Date: 2001-03-28 ...>
    
    Date.new(2001,1,31) >> 1 >> -1   #=> #<Date: 2001-01-28 ...>
    

    😂 赶紧看了一下文档,说的还是很清楚的

  • 送几本《Ruby on Rails 教程 (第 4 版)》纸质书 at October 30, 2017

    测一下人品😂

  • 写了一个 2016年 中国节假日gem,判断 Time 或 Date 是否是节日,很适合新手学习 at May 27, 2017

    😮 😮 😮 😮

  • 多态情况下关联表查询问题 at May 24, 2017

    因为不知道他 images.item_type 存的是什么,所以当小写的 book 写了

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