• 6

  • 多字段排序怎么写 at 2019年03月09日

    直接翻译就是这样了吧

    arrs.sort { |arr1, arr2| arr1.first == arr2.first ? (arr2.last <=> arr1.last) : (arr1.first <=> arr2.first) }

    这样搞不知道行不行

    arrs.sort { |arr1, arr2| (arr1.first <=> arr2.first) + (arr2.last <=> arr1.last) }

  • 还有 哈哈哈

  • 我昨天刚google这个问题,你把报错信息丢到google, 第一个结果好像就是

  • 学Ruby可以解决单身的问题,我试过

  • 十分感谢,问题解决了。嗯,我思路错了,应该去看看七牛的文档

  • 那历史总topic也不多...

    @wesley6j reddit不错!

  • 新问题没法置顶是吧。。

  • 这个问题最近又出现了,貌似

    format.js { render js: "window.location = '#{course_sections_path(@course)}'" }

    不管用了

    ActionController::RoutingError (No route matches [DELETE] "/courses/5c122c196799f367fb742aa8/sections"):
      actionpack (4.2.5) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
      actionpack (4.2.5) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
      lograge (0.7.1) lib/lograge/rails_ext/rack/logger.rb:15:in `call_app'
      railties (4.2.5) lib/rails/rack/logger.rb:20:in `block in call'
      activesupport (4.2.5) lib/active_support/tagged_logging.rb:68:in `block in tagged'
      activesupport (4.2.5) lib/active_support/tagged_logging.rb:26:in `tagged'
      activesupport (4.2.5) lib/active_support/tagged_logging.rb:68:in `tagged'
      railties (4.2.5) lib/rails/rack/logger.rb:20:in `call'
      quiet_assets (1.1.0) lib/quiet_assets.rb:27:in `call_with_quiet_assets'
      request_store (1.3.2) lib/request_store/middleware.rb:9:in `call'
      actionpack (4.2.5) lib/action_dispatch/middleware/request_id.rb:21:in `call'
      rack (1.6.10) lib/rack/methodoverride.rb:22:in `call'
      rack (1.6.10) lib/rack/runtime.rb:18:in `call'
      activesupport (4.2.5) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
      rack (1.6.10) lib/rack/lock.rb:17:in `call'
      actionpack (4.2.5) lib/action_dispatch/middleware/static.rb:116:in `call'
      rack (1.6.10) lib/rack/sendfile.rb:113:in `call'
      sentry-raven (2.7.3) lib/raven/integrations/rack.rb:51:in `call'
      railties (4.2.5) lib/rails/engine.rb:518:in `call'
      railties (4.2.5) lib/rails/application.rb:165:in `call'
      rack (1.6.10) lib/rack/content_length.rb:15:in `call'
      thin (1.7.2) lib/thin/connection.rb:86:in `block in pre_process'
      thin (1.7.2) lib/thin/connection.rb:84:in `catch'
      thin (1.7.2) lib/thin/connection.rb:84:in `pre_process'
      thin (1.7.2) lib/thin/connection.rb:53:in `process'
      thin (1.7.2) lib/thin/connection.rb:39:in `receive_data'
      eventmachine (1.2.5) lib/eventmachine.rb:194:in `run_machine'
      eventmachine (1.2.5) lib/eventmachine.rb:194:in `run'
      thin (1.7.2) lib/thin/backends/base.rb:73:in `start'
      thin (1.7.2) lib/thin/server.rb:162:in `start'
      rack (1.6.10) lib/rack/handler/thin.rb:19:in `run'
      rack (1.6.10) lib/rack/server.rb:287:in `start'
      railties (4.2.5) lib/rails/commands/server.rb:80:in `start'
      railties (4.2.5) lib/rails/commands/commands_tasks.rb:80:in `block in server'
      railties (4.2.5) lib/rails/commands/commands_tasks.rb:75:in `tap'
      railties (4.2.5) lib/rails/commands/commands_tasks.rb:75:in `server'
      railties (4.2.5) lib/rails/commands/commands_tasks.rb:39:in `run_command!'
      railties (4.2.5) lib/rails/commands.rb:17:in `<top (required)>'
      bin/rails:9:in `require'
      bin/rails:9:in `<top (required)>'
      spring (2.0.2) lib/spring/client/rails.rb:28:in `load'
      spring (2.0.2) lib/spring/client/rails.rb:28:in `call'
      spring (2.0.2) lib/spring/client/command.rb:7:in `call'
      spring (2.0.2) lib/spring/client.rb:30:in `run'
      spring (2.0.2) bin/spring:49:in `<top (required)>'
      spring (2.0.2) lib/spring/binstub.rb:31:in `load'
      spring (2.0.2) lib/spring/binstub.rb:31:in `<top (required)>'
      bin/spring:13:in `require'
      bin/spring:13:in `<top (required)>'
      bin/rails:3:in `load'
      bin/rails:3:in `<main>'
    
  • Launch School