Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
classicalliu
@classicalliu
Member
NO. 25530 / 2016-03-16

[email protected]
8 Topics / 59 Replies
2 Followers
3 Following
4 Favorites
No GitHub.
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • RSpec + FactoryBot 出现奇怪的问题 at May 23, 2019

    首先确保 User 身上有 login 属性,你这个问题看起来是因为 static attributes 导致的,factory_bot 5 已经不支持这种写法了

    login "test001"
    

    应该改成

    login { "test001" }
    

    具体可以看这里 https://thoughtbot.com/blog/deprecating-static-attributes-in-factory_bot-4-11

    100.times do |i|
    

    另外这里很奇怪,看起来你定义了 100 个 名为 :user 的 factory .... 真的没有问题么

  • Ruby China 的搜索是不是挂掉了? at October 26, 2018

    org 可以,com 搜出来就是空……

  • 如何本地编译 asset ,然后推送到云端使用? at September 08, 2018

    本地的 rails s 起的是 development 还是 production,如果是 development 的话试一下 rails s -e production,如果也读不到的话我猜是因为 production.rb 里面的设置……默认情况下 rails server 不会处理静态资源

    # Disable serving static files from the `/public` folder by default since
    # Apache or NGINX already handles this.
    config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
    
  • 关于 application.rb 文件里的 config 对象??? at July 19, 2018

    继承链倒追回去找 config 对象……

  • 关于 application.rb 文件里的 config 对象??? at July 19, 2018

    我猜应该是这段代码……

    module Rails
      class Application < Engine
        def config #:nodoc:
          @config ||= Application::Configuration.new(self.class.find_root(self.class.called_from))
        end
      end
    end
    
  • [杭州] 阿里巴巴中间件技术部高可用架构团队招聘啦... at February 05, 2018
    Base64.decode64("ZWNjaGFuZ2VyQGdtYWlsLmNvbQ==")
    
  • 报错信息是什么意思? at January 25, 2018

    看起来应该是编码问题

  • 报错信息是什么意思? at January 25, 2018

    windows?

  • Active Record 中 many to many 遇到的问题记录 at January 19, 2018

    如果采用 << append 数组,是无法保存 role_ids 的

    没看懂这句话是什么意思,无法保存难道不是因为没有 save 么……

  • Rspec 测试,有什么方法让测试代码运行后产生的数据不被清除么。 at December 22, 2017

    rails_helper.rb

    config.use_transactional_fixtures = false
    

    这样应该可以达到你的需求,不过我是没懂你为什么有这种需求……

  • Rails 传参问题 (params、@_params 有啥区别?) at December 22, 2017
    def params
      @_params ||= Parameters.new(request.parameters)
    end
    

    @_params 是个示例变量,params 是个方法 在事务里面是可以取得 params 的,如果获取不到应该不是事务的问题……

  • Rails 如何将对象转为 JSON 串,以及怎么将 JSON 串传给前端视图 at October 04, 2016

    把 Gemfile 里面 jbuilder 那行的注释去掉……

  • [已解决]字符串转换成 hash at June 23, 2016
    h = eval(w)
    
  • 求教 Rails + Puma + Nginx + Ubuntu 部署 at June 08, 2016

    #13 楼 @xiaoronglv 我晚上试试 谢谢~

  • 求教 Rails + Puma + Nginx + Ubuntu 部署 at June 08, 2016

    #13 楼 @xiaoronglv 好的👌谢谢 我晚上回去试试

  • 求教 Rails + Puma + Nginx + Ubuntu 部署 at June 08, 2016

    #11 楼 @rei 我有回答问的问题啊😳 因为弄了两天没什么进展也不知道问题在哪 期末了事情有点多就先放着了😳 我下次注意 造成的困扰非常抱歉

  • 求教 Rails + Puma + Nginx + Ubuntu 部署 at June 08, 2016

    #9 楼 @hging 这个是对的😂我上查询网站试过 其实我发现是项目部署的不对

  • C++ 入门书籍推荐 at June 08, 2016

    别纠结了,要是会写 ruby,看《C++ Primer》5th 应该还挺快的…… c++ 沉寂了多年发布了全新标准 C++11/14,你要是不维护旧项目就直接学新的吧 #6 楼 @luolinae86 提到的 2,3 两本书也有了针对新标准的《Effective modern c++》 另外给你一个小建议初学 c++ 最好用 clang/gcc,不要用 vs,跟书上代码比较对的上 不推荐任何一本国产书,尤其是谭浩强的……有多少坑你踩过就知道了

  • 求教 Rails + Puma + Nginx + Ubuntu 部署 at June 07, 2016

    #7 楼 @msg7086 好的,谢谢😬

  • 求教 Rails + Puma + Nginx + Ubuntu 部署 at June 07, 2016

    #5 楼 @msg7086 😂😂😂不太懂,过了这段时间再折腾看看

  • 求助: Ruby 数组运用的问题 at June 06, 2016

    #6 楼 @popmonker 看楼上

  • 求助: Ruby 数组运用的问题 at June 06, 2016
    @item_pack = []
    @pack1 = []
    # 你的modellist要不要换成model_list……
    model_pack = {name: nil, modellist: []}
    data_pack = {model: nil,date: []}
    
    model_pack[:name] = 1
    data_pack[:model] = "aaa"
    model_pack[:modellist] << data_pack.clone   # 传值代替传引用
    model_pack[:name] = 2
    data_pack[:model] = "bbb"
    model_pack[:modellist] << data_pack
    
    @item_pack << model_pack
    
    puts @item_pack    # 不用放在引号里……
    
  • 求教 Rails + Puma + Nginx + Ubuntu 部署 at June 04, 2016

    #2 楼 @msg7086 就是 nginx.conf 设置里面这个三个内容我都改成了 www.xxx.com 的样子,proxy_pass 还有个 http://的前缀

  • 求教 Rails + Puma + Nginx + Ubuntu 部署 at June 04, 2016

    #1 楼 @tardis 这是什么鬼😳求指教

  • mina 如何开启 sunspot at June 03, 2016

    #3 楼 @lyfi2003 好的,谢了😄等我弄好了域名试一下😅

  • mina 如何开启 sunspot at June 03, 2016

    #1 楼 @lyfi2003 就在终端执行吗∠( ᐛ」∠)_

  • RVM is not a function, selecting rubies with 'rvm use ...' will not work. at June 02, 2016

    #1 楼 @rei 果然好使,谢谢~😎

  • Rails 5.1.0 - Drop jQuery as a dependency at June 02, 2016

    #6 楼 @suffering 我知道是 rails 的作者啊……我是说他@的这个是不是真的……还是禁言用户 还有你后面那句我没看懂……😶

  • Rails 5.1.0 - Drop jQuery as a dependency at June 02, 2016

    #1 楼 @huacnlee 这个 dhh 是什么鬼😂打开一看还是禁言用户

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