Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
@wootaw
Member
NO. 7809 / 2013-06-27

[email protected]
武汉
9 Topics / 52 Replies
1 Followers
0 Following
99 Favorites
GitHub Public Repos
  • mina-yarn 2

    Yarn tasks for mina 1.x

  • oia 1

  • xlsxir 0

    Xlsx parser for the Elixir language.

  • relate-admin 0

  • activerecord-sqlserver... 0

    SQL Server Adapter For Rails

  • wootaw.github.io 0

  • doc-digger 0

    This gem generate RESTful web API documentation.

  • sticky-kit 0

    A jQuery plugin for creating smart sticky elements

  • homeland 0

    :circus_tent: Open source discussion website.

  • OpenAPI-Specification 0

    The OpenAPI Specification Repository

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • p " a\t b\n c".split (/\s+/) 中 +号的作用 at May 11, 2017

    反了,你的理解

  • p " a\t b\n c".split (/\s+/) 中 +号的作用 at May 11, 2017

    是匹配一个或多个连续空字符的意思

  • 为什么百度搜 rails5 特性会出现其他人搜索邓紫棋 at March 20, 2017

    这是百度新上线的搜索联想功能

  • 如何评价这样一位开发者? at March 13, 2017

    07 年刚接触 Rails 的时候,has_many_and_belongs_to 也卡了我一下午,不过不是因为没建中间表,而是因为给中间表里加了一个 id 字段。不过现在的项目里极少用了,因为迟早中间表会变成一个 Model,还不如开始就用两个 has_many。

  • 在项目中使用 AASM enum 全面替换 state_machines 的 migration at February 23, 2017

    不可以啊,因为在 model 里我已经把 AASM 的代码完全替换了 state_machines,这个时候再用 ActiveRecord 里的方法(.all, .where)会得到错误的数据(因为数据库里的字段类型不同了)。这个 migration 跑完后,ActiveRecord 里的方法就恢复正常了

  • 一个地区字段的小工具类 at February 17, 2017

    @w7938940

    我们用的数据是从腾讯微博设置个人信息页面上抓的,数据正好符合我们的表结构 districts

    而最新的数据在这个问题下面的回复里。

  • 这样的需求该怎么设计表结构? at February 16, 2017

    zones 把省份,城市,地区放到一张表,代码两位的是省级,4 位是市级,6 位是区/县级,部分数据如下:

    id 名称 代码
    1 北京 11
    2 河北 13
    3 太原 1401
    4 小店区 140105
    5 迎泽区 140106

    配送区域数据放一张表:

    id 配送 id 区域代码
    1 1 11
    2 1 13
    3 1 140105

    这样还能找到某区域的全部上级 (postgresql 可支持这种 sql)

    select * from zones where '140105' ~ code
    

    希望能对你有点启发

  • 如何把 JSON 中的 RTC 时间转换为 DateTime 并创建 Model? at February 15, 2017

    这么写,只保存一次数据库

    @game.assign_attributes(
      time_of_begin: Time.at(game_params[:time_of_begin]),
      time_of_end: Time.at(game_params[:time_of_end])
    )
    
  • [北京 / 武汉 / 远程] 石墨文档 做最美产品 - 寻找中国最有才华的工程师、设计师和产品经理加入 at May 17, 2016

    #3 楼 @ashchan 择日不如撞日,赶快写吧,七年 Rails 的想试一下 Node.js,学习一下然后投你们

  • 大家刚参加工作时的待遇、福利都是怎么样的? at January 21, 2016

    09 年,武汉,5000,福利:每天中午可以开两局 Dota

  • 使用 rack-cors 在 production 环境下不能响应 PUT、DELETE at October 22, 2015

    #2 楼 @qhwa 好像是 CORS 对于 PUT、DELETE 没有附上头

    OPTIONS:

    General:

    • Remote Address:123.123.123.123:80
    • Request URL:http://www.mysite.com/api/rc/209
    • Request Method:OPTIONS
    • Status Code:200 OK

    Response Headers

    • Access-Control-Allow-Credentials:true
    • Access-Control-Allow-Headers:accept, content-type
    • Access-Control-Allow-Methods:GET, POST, DELETE, PUT, OPTIONS
    • Access-Control-Allow-Origin:http://other.mysite.com
    • Access-Control-Expose-Headers:
    • Access-Control-Max-Age:1728000
    • Connection:keep-alive
    • Content-Encoding:gzip
    • Content-Type:text/plain
    • Date:Thu, 22 Oct 2015 01:52:26 GMT
    • Server:ASERVER/1.2.9-3
    • Status:200 OK
    • Transfer-Encoding:chunked
    • X-Powered-By-Anquanbao:MISS from chn-wh-cq-se2

    Request Headers

    • Accept:/
    • Accept-Encoding:gzip, deflate, sdch
    • Accept-Language:zh-CN,zh;q=0.8,en;q=0.6,zh-TW;q=0.4
    • Access-Control-Request-Headers:accept, content-type
    • Access-Control-Request-Method:DELETE
    • Connection:keep-alive
    • Host:www.mysite.com
    • Origin:http://other.mysite.com
    • Referer:http://other.mysite.com/path
    • User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 - Safari/537.36

    DELETE

    General:

    • Remote Address:123.123.123.123:80
    • Request URL:http://www.mysite.com/api/rc/209
    • Request Method:DELETE
    • Status Code:405 Not Allowed

    Response Headers

    • Connection:keep-alive
    • Content-Type:text/html
    • Date:Thu, 22 Oct 2015 01:52:26 GMT
    • Server:ASERVER/1.2.9-3
    • Transfer-Encoding:chunked
    • X-Powered-By-Anquanbao:MISS from chn-wh-cq-se2

    Request Headers

    • Accept:application/json, text/plain, /
    • Accept-Encoding:gzip, deflate, sdch
    • Accept-Language:zh-CN,zh;q=0.8,en;q=0.6,zh-TW;q=0.4
    • Connection:keep-alive
    • Content-Length:2
    • Content-Type:application/json
    • Host:www.mysite.com
    • Origin:http://other.mysite.com
    • Referer:http://other.mysite.com/path
    • User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36
  • 使用 rack-cors 在 production 环境下不能响应 PUT、DELETE at October 22, 2015

    #1 楼 @42thcoder config.ru 试过,同样不行

    in config.ru

    require 'rack/cors'
    use Rack::Cors do
      allow do
        origins '*'
        resource '*', :headers => :any, :methods => [:get, :post, :delete, :put, :options]
      end
    end
    
  • Mina 部署时遇到 GitHub 的校验问题 at August 13, 2015

    解决了!谢谢!

  • [武汉] 道源科技招聘 Rails 开发工程师 / Rails 开发实习生 / Web 前端开发工程师 at February 27, 2014

    早三个月发呀!现在也在转盘这里了!

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