Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
Hooopo
@hooopo
Admin
NO. 8 / 2011-10-28

[email protected]
nil
北京
160 Topics / 3013 Replies
360 Followers
0 Following
74 Favorites
聪明的妖怪录下了唐僧的紧箍咒
Reward
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
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • Rails with massive data at August 23, 2012

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

  • 还是 rails 中执行 shell 脚本遇到的问题 at August 22, 2012

    awesome...什么是 pipe 冲突

  • 新一代码农女神? at August 22, 2012

    http://vimeo.com/12665599

  • Rails log 自动分割该怎么配置才正确 at August 21, 2012

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

  • [新手向] ActiveRecord::Base 与 ActiveRecord::Relation 关系及基本原理 at August 21, 2012

    结论还没说出本质啊

  • 怎样启动一个进程而不受当前 ruby 进程影响 at August 21, 2012

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

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

    #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 August 21, 2012

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

  • 多台服务器同步配置文件 at August 21, 2012

    Puppet is what you want

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

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

  • ruby-china 代码中关于 seo 的部份 at August 21, 2012

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

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

    http://iwanttolearnruby.com/

  • 谁说 Ubuntu 好用? at August 19, 2012

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

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

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

    #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 August 19, 2012

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

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

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

  • ruby-china 代码中关于 seo 的部份 at August 19, 2012

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

  • 怎样处理 url 的 encoding 错误 at August 19, 2012

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

  • ruby-china 代码中关于 seo 的部份 at August 19, 2012

    #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 August 19, 2012

    显然不一样啊:

    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 August 18, 2012

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

  • 是不是需要禁止用户名为某个 controller? at August 18, 2012

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

  • [杭州] 招人来和我一起做运维平台 at August 18, 2012

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

  • [杭州] 招人来和我一起做运维平台 at August 18, 2012

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

  • 有没有办法让没有写测试的代码无法提交到代码库? at August 17, 2012

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

  • Rails 适合做 Linux 系统管理方面的系统吗? at August 17, 2012

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

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