• Rails 5.1 released 🎉🎊 at 2017年4月28日

    有人抢了我的sass-rails Rails 5.1 兼容PR 😂

  • 可以看看这篇blog,我之前做过一个类似的,似乎不需要复写rails.confirm就可以了。

    $.rails.allowAction = function(element){
      var message = element.data("confirm");
      if (!message) { return true; }
    
      $(".confirm-message").html(message)
      $("#confirm_message").show();
      setTimeout(function(){
        $("#confirm_message").children(".confirm-div").addClass("mask-show");
      }, 10);
      $("#confirm_ok").click(function(){
        element.data("confirm", null);
        element.trigger("click.rails");
        element.data("confirm", message);
        $("#confirm_message").hide();
      });
      return false;
    }
    
    document.addEventListener("turbolinks:load", function() {
      $("#confirm_close").click(function(){
        $("#confirm_message").hide();
      });
    });
    
  • 我也是phantomjs 2.1.1,我会报这个错,虽然可以加page.driver.browser.js_errors = false,单感觉这办法不好。

    Error:
    NewProductTest#test_create_a_new_product:
    Capybara::Poltergeist::JavascriptError: One or more errors were raised in the Javascript code on the page. If you don't care about these errors, you can ignore them by setting js_errors: false in your Poltergeist configuration (see documentation for details).
    
    TypeError: undefined is not an object (evaluating 'handler.call')
    TypeError: undefined is not an object (evaluating 'handler.call')
        at http://127.0.0.1:52934/assets/application-98eeb46022232c75bc6d2971073ca25d12383cefe13cc520805de10f77a13424.js:145
        at :0 in sendEvent
        at phantomjs://code/web_page.js:59
        at phantomjs://code/web_page.js:558 in mouseEvent
        at phantomjs://code/node.js:67 in mouseEvent
        at phantomjs://code/browser.js:398 in mouse_event
        at phantomjs://code/browser.js:418 in click
        at phantomjs://code/browser.js:89 in runCommand
        at phantomjs://code/cmd.js:35 in run
        at phantomjs://code/main.js:17 in runCommand
        at phantomjs://code/connection.js:16 in commandReceived
        at phantomjs://code/connection.js:1
    TypeError: undefined is not an object (evaluating 'handler.call')
    TypeError: undefined is not an object (evaluating 'handler.call')
        at http://127.0.0.1:52934/assets/application-98eeb46022232c75bc6d2971073ca25d12383cefe13cc520805de10f77a13424.js:145
        at :0 in sendEvent
        at phantomjs://code/web_page.js:59
        at phantomjs://code/web_page.js:558 in mouseEvent
        at phantomjs://code/node.js:67 in mouseEvent
        at phantomjs://code/browser.js:398 in mouse_event
        at phantomjs://code/browser.js:418 in click
        at phantomjs://code/browser.js:89 in runCommand
        at phantomjs://code/cmd.js:35 in run
        at phantomjs://code/main.js:17 in runCommand
        at phantomjs://code/connection.js:16 in commandReceived
        at phantomjs://code/connection.js:1
        test/integration/new_product_test.rb:12:in `block in <class:NewProductTest>'
    
  • 这gem怎么用?

  • capistrano3-puma从2到3是个大版本升级,当然需要看一下Usage,如果看一下的话,其实这个问题根本就不应该说是诡异异常。

  • 把gem文件clone到本地,然后在用到的Gemfile中直接引用即可。

    # $ bundle config --local local.wechat /Users/guochunzhong/git/oss/wechat
    gem 'wechat', git: 'https://github.com/Eric-Guo/wechat', branch: :master
    

    如果要autoloading这个gem,在development.rb中启用:

    config.autoload_paths += Dir["#{config.root}/../oss/wechat/lib/**/"]
    

    这个方法比直接引用path好的地方在于,不影响deploy。

  • 求问怎么样才能认识半年吃一次饭,一次给200万的朋友。

  • app目录下任何修改都不用,其他目录都需要,config目录,除了routes.rb以外的任何文件。(假设用默认设置)

  • 同意楼上,并且删掉.rvm后别用rvm了,通过brew install ruby装吧,你只要一个版本的话,还是用brew方便。

  • 主要是这段,我也准备在wechat gem上支持一下,一直没时间。。