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

[email protected]
深圳
188 篇帖子 / 9160 条回帖
731 关注者
0 正在关注
11 收藏
中下水平 Rails 程序员
打赏作者
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**

  • geeknote 34

  • 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

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • 如何在结果集中再次查询? at 2013年07月11日

    一般做法是在当前查询条件上再加查询条件,服务端根据新的条件再查一次

  • 调用外部程序要小心 at 2013年07月11日

    #1 楼 @luikore 学习了,之前不知道有 shellescape 这个方法。

    我也是用 *%W,为了避免讲解语法所以用简单的数组。

    #3 楼 @huacnlee 好东西,检出几个潜在漏洞

  • 贵圈真乱 at 2013年07月11日

    男女搭配干活不累,但我觉得这个不要低俗化,拍张男女平衡朝气蓬勃的合照就好了。

  • [南京] 暴走漫画招聘 rails 程序员 (内有无节操图,慎入) at 2013年07月11日

    肯定是男孩子。

  • 关于 rails 版本的选择问题 at 2013年07月11日

    跟着书学,社区 wiki 更新并不及时。

  • Mongoid 里的 includes 怎么是个陷阱? at 2013年07月11日

    #5 楼 @hlxwell 这两个比较不对称,要比较的是 words 用 "list_id" => id 和 words "list_id" => {"$in" => [id]} 的差别,第二个语句没有查询 words。

  • Mongoid 里的 includes 怎么是个陷阱? at 2013年07月11日

    #3 楼 @hlxwell 差了多少?

  • Mongoid 能否支持虚拟字段? at 2013年07月11日

    是 to_json 处理。

    试试

    get do
      User.find(...).to_json(:methods => [:name])
    end
    

    我没用过 Grape,不知道是否正确。

  • Mongoid 里的 includes 怎么是个陷阱? at 2013年07月11日

    MySQL 的 in 查询也不行,即使加了索引。所以这个问题最后要用 cache 解决。

    不过我也没做过严谨测试。

  • 如何实现 hit counter 功能 at 2013年07月10日

    #5 楼 @cameo 简单实现可以用 mongodb 的 addToSet,mongoid 的 add_to_set,把 ip 存进去,然后计算数组长度。数据大了再做优化。

  • 如何实现 hit counter 功能 at 2013年07月09日

    #3 楼 @cameo 奥,我搞错了,counter 是这个 https://github.com/nateware/redis-objects

    unique 是指针对哪个条件?

  • slim 出错,不知道什么问题了 at 2013年07月09日

    td 前面一个空格,= 前面 5 个空格,都是不合法的。

  • 如何实现 hit counter 功能 at 2013年07月09日

    Ruby China 的实现逻辑在这里 https://github.com/ruby-china/ruby-china/blob/master/app/models/mongoid/counter_cache.rb

    我做的话会直接调用 mongoid 的 inc 操作。http://mongoid.org/en/mongoid/docs/persistence.html

  • Rails4.0 + mongoid3.1.4 bundle 出错 at 2013年07月08日

    参考 Ruby China 的 Gemfile https://github.com/ruby-china/ruby-china/blob/master/Gemfile

    除了 Mongoid 外还有相关的 *-mongoid gem 要升级,很多都只有 git,未发稳定版。

  • 有人用 Sublime Text 3 吗 at 2013年07月08日

    #27 楼 @yunzifeiyu 1 年

  • 关于 belong_to 的问题 at 2013年07月08日

    user.organization.organName

  • Turbolinks 后端逻辑分析 (更新总集篇) at 2013年07月08日

    #37 楼 @Victor 可以用这个插件 https://github.com/kossnocorp/jquery.turbolinks

  • 发现个不错的论坛系统 at 2013年07月07日

    http://ruby-china.org/topics/8628

  • sublime text 2 自动备份文件 at 2013年07月06日

    保存到 Dropbox?Dropbox 每次修改都记录版本。本地保存的问题是保存再多的版本,硬盘挂了就都没了。

  • 为什么不再来一次? at 2013年07月06日

    优秀的程序员不会在生产环境测试。

  • discourse 源码中,为什么一个页面 handlebars 一份,views 一份? at 2013年07月06日

    看了历史记录还真是后加的 https://github.com/discourse/discourse/commits/master/app/views/categories/index.html.erb

    Show something on categories page when js is disabled

  • discourse 源码中,为什么一个页面 handlebars 一份,views 一份? at 2013年07月06日

    给没有 js 的访问者看,比如搜索引擎。

  • 一个'五年'java developer 的现状 at 2013年07月06日

    JavaZone2013 年度大片《Java 末日》预告片 http://www.aqee.net/javazone-2013-javapocalypse/

  • The Ћ Symbol at 2013年07月05日

    好像在抬腿勾引

  • 关于 Rails 路由 at 2013年07月05日

    这段参数是传给什么方法的?生成了什么内容?

    "menus" : [{
    "menuname" : "组织管理",
    "icon" : "icon-nav",
    "url" : "/organization/index"
    },
    
  • 关于 Rails 路由 at 2013年07月05日

    #6 楼 @yuan_yp

    match ':controller(/:action(/:id))(.:format)'
    

    根据这条路由,"/organization/index" 指向的是 OrganizationController 的 index action。

    为什么 view 的 url 跟顶楼的不同?

    PS:你可以编辑顶楼内容看看怎么用 markdown 格式化代码。

  • 关于 Rails 路由 at 2013年07月05日

    #4 楼 @yuan_yp 贴 routes.rb 内容

    你对 MVC 理解不清晰,浏览器的请求首先是到达 dispatch(route),然后指派给 controller 某个 action,action 查询所需的 model,然后 render view。猜你说的“请求在 view”层应该说是 view 里面加了个链接,但是对解决问题没有帮助,需要看 routes 和 view 的源码。

  • 关于 Rails 路由 at 2013年07月05日

    我给代码格式化了,楼主看看我修改的内容。

  • Turbolinks 后端逻辑分析 (更新总集篇) at 2013年07月05日

    #31 楼 @huobazi 意思是 ready 在 Turbolinks.visit 的时候是不触发的,如果另一个页面的逻辑是写在 ready 里面,那么不会执行。如果能执行,可能 Turbolinks 没起作用。能把网站发我看看吗?

  • 在 Ubuntu 上遇到 rb-inotify 和 ffi 版本相关的诡异问题 at 2013年07月05日

    这似乎是 windows 下 bundle 的 Gemfile.lock 带到 Linux 引起的情况?我不知道怎么解决……或者把 Gemfile.lock 删了再 bundle。

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