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

hooopo@gmail.com
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 的模板系统比较复杂,有没有输入模板代码可以立马看到 html 代码的方法? at June 22, 2012

    Rails console:

    ruby-1.9.3-p0 :025 > $a = "<script>alert(1)</script>here"
     => "<script>alert(1)</script>here" 
    ruby-1.9.3-p0 :026 > helper.render :inline => "<%= $a %>"
     => "&lt;script&gt;alert(1)&lt;/script&gt;here" 
    

    注意,这里不能用实例变量,因为真实的模板处理还有一个步骤是把 controller 里的实例变量注入到模板里面。在 console 里只能用全局变量代替了。

  • 一个好玩的想法 at June 22, 2012

    #5 楼 @zlx_star 很正常啊 以前找工作的时候遇到两个公司,都是 5、6 个人轮流面试。

  • rails tricks: pluck (ActiveRecord) at June 21, 2012

    贴代码要加高亮啊

  • Gemfile 里同一个 Gem 可以根据不同的 Ruby 版本制定不同的版本吗? at June 21, 2012

    #2 楼 @inetufo 这个错误很明显呀 可能其他 gem 依赖了 xxx,和你指定的 xxx 版本号不匹配

  • 最近好像坛子里有点火气太旺 at June 20, 2012

    有吵架帖挺好的啊 太和谐的也不好 要适度。。适度。。

  • 最近北京有没有 ruby 聚会之类的活动? at June 20, 2012

    玩什么?

  • Sidekiq & Resque 启动要占用一个 cli 好麻烦啊~ 能放后台吗? at June 20, 2012

    #10 楼 @qichunren 。。。system 方法不带环境的 功能有限。 你这种需求有好多 gem 的。

  • Sidekiq & Resque 启动要占用一个 cli 好麻烦啊~ 能放后台吗? at June 20, 2012

    #7 楼 @qichunren 不就是 fork 么

  • Smart HTTP Protocal Internals at June 20, 2012

    #19 楼 @bhuztez 你要这么挑剔就写一个不需要重新编译的 nginx 啦

  • and 和 && 是不同的 at June 20, 2012

    优先级问题大部分入门书上都有讲的...不过我前几天就犯过一个这样的错误.......

  • Sidekiq & Resque 启动要占用一个 cli 好麻烦啊~ 能放后台吗? at June 20, 2012

    #2 楼 @ruohanc foreman foreman foreman!

  • Sidekiq & Resque 启动要占用一个 cli 好麻烦啊~ 能放后台吗? at June 20, 2012

    没看懂

  • Smart HTTP Protocal Internals at June 20, 2012

    #14 楼 @bhuztez 我一直以为你是 ray_linn 的马甲...

  • Gemfile 里同一个 Gem 可以根据不同的 Ruby 版本制定不同的版本吗? at June 20, 2012

    报什么错啊?

    PLATFORMS (:platforms)
    If a gem should only be used in a particular platform or set of platforms, you can specify them. Platforms are essentially identical to groups, except that you do not need to use the --without install-time flag to exclude groups of gems for other platforms.
    
    There are a number of Gemfile platforms:
    
    ruby
    C Ruby (MRI) or Rubinius, but NOT Windows
    ruby_18
    ruby AND version 1.8
    ruby_19
    ruby AND version 1.9
    mri
    Same as ruby, but not Rubinius
    mri_18
    mri AND version 1.8
    mri_19
    mri AND version 1.9
    rbx
    Same as ruby, but only Rubinius (not MRI)
    jruby
    JRuby
    mswin
    Windows
    mingw
    Windows 'mingw32' platform (aka RubyInstaller)
    mingw_18
    mingw AND version 1.8
    mingw_19
    mingw AND version 1.9
    As with groups, you can specify one or more platforms:
    
    gem "weakling",   :platforms => :jruby
    gem "ruby-debug", :platforms => :mri_18
    gem "nokogiri",   :platforms => [:mri_18, :jruby]
    All operations involving groups (bundle install, Bundler.setup, Bundler.require) behave exactly the same as if any groups not matching the current platform were explicitly excluded.
    
  • 如何处理 Rails 3.0 之前的 plugin? at June 19, 2012

    #4 楼 @googya 按你说的出现识别不了相应模块 可能的原因就是加载顺序依赖出现了问题

  • 如何处理 Rails 3.0 之前的 plugin? at June 19, 2012

    你得先搞清楚 Rails 初始化的加载顺序:http://rubyeye.herokuapp.com/articles/21-rails-%E5%88%9D%E5%A7%8B%E5%8C%96%E5%8A%A0%E8%BD%BD%E9%A1%BA%E5%BA%8F

  • Rails 对数据库操作解疑 at June 19, 2012

    count 操作出问题了就去优化 count 啊 和存储过程什么关系?

  • 请见多识广之人介绍一个团购 Rails 开源项目 at June 18, 2012

    没用过团购系统。不清楚。

  • 如何取出一个字段 (不重复数据的 TOP10)? at June 17, 2012

    如果你要问就目前你说的这样的场景如何排序我想不出不需要进行 Filesort 的方法。

    如果重新设计一下可以这样: 1.添加一个 url_count 字段,加索引。 2.插入之前先查询,如果存在就 url_count + 1。 3.select * from urls order by url_count desc limit 10

    查询的时候: select id from urls where url="xx" and url_crc=CRC32("xx"); url_crc 列也要加索引。

  • 关于 Array 在 each 中 delete 问题?! at June 15, 2012

    先 dup 一下啊

    a=[1,2,3,4,5,6,7,8,9]
    b = a.dup
     => [1, 2, 3, 4, 5, 6, 7, 8, 9] 
     a.each do |i|
       b.delete(i)
     end
     => [2, 4, 6, 8] 
    
  • http://open-dyi.org at June 15, 2012

    中国人搞的?

  • 大家给我新做的 Android 应用的用户论坛提点建议 at June 15, 2012

    躺着也中枪:-)

    1.tags 没必要用 redis,mysql 可以试试这个 gem(https://github.com/mbleigh/acts-as-taggable-onMongodb大概在topic里加一个数组字段tags就ok。),

    2.没用过。

    3.这东西流程好复杂,简单的办法就是里两个帐号就创建两个用户,没有任何关联。

    4.把用户 id 和投过票的 topic 的 id 组合起来就行。mysql 可以在这个中间表上加复合索引,判断是否投过票的时候很快的。

    ps.这个论坛里面也没有数据呀,怎么会慢。。。

  • Jing.fm 感觉这个网站真的很赞啊~ at June 14, 2012

    听不到声音 Orz

  • 请问有什么国外的 Ruby on Rails 社区介绍么? at June 14, 2012

    comp.lang.ruby.group

  • 编程语言 2012 年 6 月 排行榜 Ruby 重回 Top 10 at June 13, 2012

    #15 楼 @ery 是哇 这又有什么关系呢

  • Rails 3.2.6 released at June 13, 2012

    #9 楼 @ShiningRay 3.2 的版本只能是安全性补丁呀

  • FactoryGirl 粗浅介绍 at June 13, 2012

    #3 楼 @chucai 你们把楼主的文章当黄色小说看哇啊啊 啊

  • 这样的数字序列,应该怎样写 at June 12, 2012

    不行啊 00 是 8 进制的,里面出现比 7 大的就报错

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