Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
@libuchao
Member
NO. 4002 / 2012-10-10

杭州
2 Topics / 216 Replies
2 Followers
0 Following
84 Favorites
No GitHub.
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • rails s 报错 Could not find erubis at February 26, 2015

    #3 楼 @easonlovejiven

    Could not find erubis-2.7.0 in any of the sources Run bundle install to install missing gems.

    这还不够明白?

  • rails s 报错 Could not find erubis at February 26, 2015

    楼主已经自问自答了

  • MySQL id 值越来越大,咋办? at February 13, 2015

    http://lmgtfy.com/?q=mysql+integer+max+limit

  • 同一个 Rails 项目中如何使用两套 layout? at February 10, 2015

    http://guides.rubyonrails.org/layouts_and_rendering.html#finding-layouts

    楼主提问前确实应该自己搜搜

  • 同一个 Rails 项目中如何使用两套 layout? at February 10, 2015
    # app/controllers/admin/application_controller.rb
    class Admin::ApplicationController < ApplicationController
      layout "admin" # app/views/layouts/admin.html.erb
      ...
    end
    
  • 有什么分区段产生随机数的好办法嘛? at February 09, 2015

    思路

    x = Random.rand(1..100)
    
    if (1..80).include? x
      return Random.rand(1..10)
    elsif (81..100).include? x
      return Random.rand(10..20)
    end
    
  • 哪里有常用 gem 的比较详细的介绍 at February 02, 2015

    详细信息请去 repo 主页上看

  • Ubuntu 下的 Workflow? at January 31, 2015

    主要 Terminal + Text Editor + Browser 三大件就可以了。当然,Ubuntu 下你仍旧可以使用 RubyMine。

  • [已解决] 图片上传遭拒,是 capistrano3 + carrierwave 问题,还是权限问题? at January 26, 2015

    不管你 HEAD 里有没有指定 favicon.ico 路径,有些浏览器还是会自作聪明地从跟目录下 GET 一下 favicon.ico。

    解决方法就是在 public 目录下放一个 favicon.ico。

  • [已解决] 你们真的会用 DigitalOcean5 美元的方案吗? at January 22, 2015

    DO 512 RAM 和 Linode 512 RAM 都用过,小应用完全没问题

  • ruby-china 的存储依赖怎么那么多? at January 22, 2015

    #4 楼 @yuankui 也可稍微看下 https://github.com/libuchao/forum.rb ,依赖略少,功能也略少。

  • Rails4.2 assets 目录中.keep 文件是什么意思啊,有什么用呢? at January 16, 2015

    空文件夹不会被 git 纳入版本控制,所以放个空白文件进去。 当然,文件名称随便取,.keep 只是一个约定。

  • 送给初学者一本 ruby 小电子书 at January 04, 2015

    1 楼说得对

    #3 楼 @chenge

    这就看缘分了,注册一下不过几分钟而已

    注册就算了,居然还要验证手机号,天生抵触这种服务

  • 碰到一个奇怪的问题,(0.6/0.2).to_i=? at December 23, 2014

    #9 楼 @liuxiang511240 巧合

  • 在这种出现 routes 冲突时大家会怎样做呢? at December 15, 2014

    routes

    get 'user/:username'     => 'users#show'
    get ':username'          => 'users#show'
    

    helper

    RESERVE_USERNAMES = %w(login register logout categories)
    
    def user_path user
      if RESERVE_USERNAMES.include? user.username.downcase
        '/user/' + user.username
      else
        '/' + user.username
      end
    end
    
  • 咨询一个 form 表单的问题 at December 12, 2014

    http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection.html

  • 请问如何禁止以 query string 的形式访问接口 at December 05, 2014

    这个是路由控制的啊

    默认情况下

    ruby-china.org/topics/23048 定位到 topics#show ruby-china.org/topics?id=23048 定位到 topics#index

    关键看你路由和控制器里怎么写的

  • 如果我要在 rails 里面写一个可能被很多 controller 调用的 public def,我该写在哪儿啊? at December 01, 2014

    放 ApplicationController 里

    helper_method :add
    
    def add(a, b)
      return a + b
    end
    
  • 请教一下这个功能是如何做的呢? at November 30, 2014

    gem 'select2-rails'

  • 作为开发者,你喜欢 markdown 还是所见即所得的编辑器 at November 28, 2014

    Markdown

  • Ruby 如何用 for 循环打印一个三角形? at November 11, 2014

    #8 楼 @Rei 嗯,没看清楚

  • 做个简单的浏览器邮件发送客户端 at November 05, 2014

    #2 楼 @abellong 那你得去查看下收到邮件的 html 代码了,这需要你自己去 Debug

  • 做个简单的浏览器邮件发送客户端 at November 05, 2014

    跟普通的 View 类似,用 abc.html.erb 文件渲染邮件内容

    http://guides.rubyonrails.org/action_mailer_basics.html

  • 多条件查询怎么写语句 at November 04, 2014
    @var = ....
    
    if condition1
      @var = @var.where condition1
    end
    
    if condition2
      @var = @var.where condition2
    end
    
    if condition3
      @var = @var.where condition3
    end
    
    ...
    
  • Sohu PaaS 1 元计划 不要白不要! at November 04, 2014

    #5 楼 @gumpls 明明就是广告,有什么好掩饰的。搜狐云的营销人员真是有点搞笑,每隔几天就在不同社区发布雷同的没什么营养的硬广告

  • Rails 有关 Routes 的问题 at November 03, 2014

    是的,如果实在不适应的话,尝试 form_for(@user, :remote => true ...,用 Ajax 表单去搞定比较完美

  • 性能监控的好工具 - NewRelic 简介 at October 31, 2014

    #2 楼 @glz1992 #3 楼 @cisolarix 早就聊过了

    http://teahour.fm/2013/12/23/interview-with-quakewang-about-chanyouji.html

  • 关于 ruby 中写 js 的疑惑 at October 27, 2014

    #2 楼 @shangrenzhidao 不行的,参考 https://ruby-china.org/topics/20249

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