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

hooopo@gmail.com
nil
北京
160 篇帖子 / 3013 条回帖
360 关注者
0 正在关注
74 收藏
聪明的妖怪录下了唐僧的紧箍咒
打赏作者
GitHub Public Repos
  • oh-my-github-circles 47

    GitHub User Circle Generator Using GitHub Actions

  • hackernews-insight 21

    Hackernews Insight using TiDB Cloud

  • repo-track-pipeline 6

    🔄 A flexible open-source data pipeline for seamlessly syncing data from any repository to your da...

  • oh-my-github-pipeline 6

    🔄 A flexible open-source data pipeline for seamlessly syncing data from any github user to your d...

  • chatgpt-xiaoai 3

    小爱音箱集成LLM,SaaS 服务

  • repo-contributor-circles 1

    GitHub repo contributor circles generator.

  • ossinsight-x 1

    Automatically post trending repos to Twitter every day.

  • mi-service 1

    XiaoMi Cloud Service for mi.com

  • hooopo 0

  • streamlit-echarts-demo 0

    Demo for Streamlit ECharts component

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • Rails with massive data at 2012年08月23日

    #15 楼 @reducm 你的文章每秒有多少的访问量?搞得这么麻烦。

  • 还是 rails 中执行 shell 脚本遇到的问题 at 2012年08月22日

    awesome...什么是 pipe 冲突

  • 新一代码农女神? at 2012年08月22日

    http://vimeo.com/12665599

  • Rails log 自动分割该怎么配置才正确 at 2012年08月21日

    #22 楼 @quakewang 最新版的 thin 也支持这种给进程发送信号来重新加载日志的特性

  • [新手向] ActiveRecord::Base 与 ActiveRecord::Relation 关系及基本原理 at 2012年08月21日

    结论还没说出本质啊

  • 怎样启动一个进程而不受当前 ruby 进程影响 at 2012年08月21日

    #5 楼 @fsword 理论上像 brakeman、foreman 这样的不需要加载的程序也需要放到 gemfile。因为这些也是依赖

    gem "brakeman", :require => false
    
  • 怎样启动一个进程而不受当前 ruby 进程影响 at 2012年08月21日

    #3 楼 @fsword system("xx") 都算 shelling out

    Shelling out When shelling out (using the system or backticks methods, for example), Bundler's environment changes will propogate to the subshell environment. If you desire to shell out without Bundler's environment changes, simply employ the with_clean_env method. It will restore all environment variables to what they were before Bundler was activated. For example:

    Bundler.with_clean_env do
      `brew install wget`
    end
    
  • 怎样启动一个进程而不受当前 ruby 进程影响 at 2012年08月21日

    如何理解不受当前进程影响? shelling out 不就可以吗

  • 多台服务器同步配置文件 at 2012年08月21日

    Puppet is what you want

  • 六级没过,这意味着我学习 Ruby 又多了一点障碍 at 2012年08月21日

    4 级没过。。还差好多分。。

  • ruby-china 代码中关于 seo 的部份 at 2012年08月21日

    #6 楼 @jhjguxin seo 和 title 可能是动态的,比如和文章标题或标签有关。用 yml 不灵活。

  • 网上有哪些付费的学习资源,各位大神推荐一下 at 2012年08月20日

    http://iwanttolearnruby.com/

  • 谁说 Ubuntu 好用? at 2012年08月19日

    想起了这个神帖:http://www.douban.com/group/topic/19177994/

    ps,这个帖子的楼主已经把原文编辑掉了。。

  • 做个小调查,读过 Rails 源码的举一下手。 at 2012年08月19日

    #21 楼 @ery 还是用 ActiveRecord::Associations::Builder::BelongsTo.build 这个例子: 根据 Ruby 的目录组织习惯,BelongsTo 这个类应该在 active_record/associations/builder/belongs_to.rb 里定义的。 进去一看,嗨,还真找到了...

    还有一些继承的,去看父类或 Mixin 就可以了。Rails 做的很好了,注释里都有继承关系:

    #   Association
    #     SingularAssociation
    #       HasOneAssociation
    #         HasOneThroughAssociation + ThroughAssociation
    #       BelongsToAssociation
    #         BelongsToPolymorphicAssociation
    #     CollectionAssociation
    #       HasAndBelongsToManyAssociation
    #       HasManyAssociation
    #         HasManyThroughAssociation + ThroughAssociation
    
  • 国内的开源项目很不靠谱啊 at 2012年08月19日

    #1 楼 @ywencn 蜗牛你说什么了?

  • 网上有哪些付费的学习资源,各位大神推荐一下 at 2012年08月19日

    #14 楼 @iwinux 我也推荐看书的,这里有豆列:http://book.douban.com/doulist/1518168/

  • ruby-china 代码中关于 seo 的部份 at 2012年08月19日

    #3 楼 @ywencn 这已经是 helper 了。。主要是 erb 里写 block 都这样啊 换成花括号就一行了

  • 怎样处理 url 的 encoding 错误 at 2012年08月19日

    其实你可以先看看这样请求的 User agent。看看是不是一些非浏览器程序搞的。如果是的话就封掉好了。

  • ruby-china 代码中关于 seo 的部份 at 2012年08月19日

    #1 楼 @ywencn 啊 最近也遇到这方面的问题,最后的解决方案是这样的: 像 meta keywords 还有 page title 或 javascript/css 这些页面里固定位置的元素渲染都不用实例变量去搞,而是用 content_for。用 controller 去做这样的事情有几个确定:

    1.从职责角度来讲,这完全不是 controller 应该做的,是 view 的职责。 2.会初始化很多莫名其妙的实例变量(虽然 Rails 里 controller 和 view 之间就是这样通讯的,但我还是看着不舒服...) 3.controller 代码增多。

    application.html.erb:

    <title><%= yield :page_title || "default page title" %></title>
    <meta name="keywords" content="<%= yield :keywords || "default keywords" %>" />
    

    然后在 view 里 render:

    <% content_for :page_title  do %>
      这里是页面标题
    <% end %>
    
    <%= content_for :keywords do %>
      这里是keywords
    <% end %>
    
  • request.body 和 params 是不是一样的? at 2012年08月19日

    显然不一样啊:

    app.get "articles/1"
      Article Load (0.3ms)  SELECT `articles`.* FROM `articles` WHERE `articles`.`id` = 1 LIMIT 1
    [8] pry(main)> app.request.params
    => {"action"=>"show", "controller"=>"articles", "id"=>"1"}
    [9] pry(main)> app.request.body
    => #<StringIO:0x0000000532d188>
    
    
  • 是不是需要禁止用户名为某个 controller? at 2012年08月18日

    去 github 注册输入 404 会提示“Username is a reserved word, is already taken.” 在 validation 里加一个保留词判断就 ok 了。

  • 是不是需要禁止用户名为某个 controller? at 2012年08月18日

    #3 楼 @huacnlee 其实 @404 同学一直就叫 404.......这次真的 404 了!

  • [杭州] 招人来和我一起做运维平台 at 2012年08月18日

    #37 楼 @fsword 和开发环境不同说明出现了问题,有这个才能及早发现。如果是不严重的问题比如字段顺序不一样,开发环境再重新迁移一下就同步了。

  • [杭州] 招人来和我一起做运维平台 at 2012年08月18日

    #35 楼 @fsword 为神马要 ignore shema.rb?

  • 有没有办法让没有写测试的代码无法提交到代码库? at 2012年08月17日

    靠,蜗牛都开始写测试了。。

  • Rails 适合做 Linux 系统管理方面的系统吗? at 2012年08月17日

    可以看一下这个:http://www.peritor.com/en/products/webistrano/ https://github.com/peritor/webistrano

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