• 最后顶一下吧

  • 我还得多加一行 resource.tag=params[resource_name][:tag]才行,devise 真有处理别的数据输入的功能吗

  • #3 楼 @small_fish__ 是吗,倒是第一次看到翻译缺失现象..

  • #4 楼 @huacnlee 原来如此!

  • #1 楼 @huacnlee

    fail(ActiveRecord::RecordNotFound.new(slug: slug))
    

    表示什么意思呢?找了好久,不明白

  • #1 楼 @huacnlee 这 gem 果然好东西,学习了

  • #3 楼 @hww 好,我看看这个 gem,谢啦

  • 哇,这么快 我试试

  • 谢谢各位,我已经转使用 postgreSQL 数据库了!

  • ruby-china 源码里有:

    create_table "topics", force: :cascade do |t|
        t.integer  "user_id",                               null: false
        t.integer  "node_id",                               null: false
        t.string   "title",                                 null: false
        t.text     "body",                                  null: false
        t.text     "body_html"
        t.integer  "last_reply_id"
        t.integer  "last_reply_user_id"
        t.string   "last_reply_user_login"
        t.string   "node_name"
        t.string   "who_deleted"
        t.integer  "last_active_mark"
        t.boolean  "lock_node",             default: false
        t.datetime "suggested_at"
        t.integer  "excellent",             default: 0
        t.datetime "replied_at"
        t.integer  "replies_count",         default: 0,     null: false
        t.integer  "likes_count",           default: 0
        t.integer  "follower_ids",          default: [],                 array: true
        t.integer  "liked_user_ids",        default: [],                 array: true # 这里可以将其保存为数组?
        t.integer  "mentioned_user_ids",    default: [],                 array: true
        t.datetime "deleted_at"
        t.datetime "created_at"
        t.datetime "updated_at"
      end
    
  • #3 楼 @billy 只能用 serialize 这个来实现存放数组的功能么

  • 网上查了下, https://github.com/rails/rails/issues/10432 这里似乎也有同样问题的人

  • #4 楼 @imconfused 哦,原来如此,谢谢!

  • #1 楼 @imconfused

    Started GET "/plans/85/edit" for 127.0.0.1 at 2016-04-09 12:56:16 +0800
    Processing by PlansController#edit as HTML
      Parameters: {"id"=>"85"}
      Plan Load (0.1ms)  SELECT  "plans".* FROM "plans" WHERE "plans"."id" = ? LIMIT 1  [["id", 85]]
    Completed 404 Not Found in 8ms (ActiveRecord: 0.5ms)
    
    ActiveRecord::RecordNotFound (Couldn't find Plan with 'id'=85):
      activerecord (4.2.5.1) lib/active_record/core.rb:155:in `find'
      cancancan (1.13.1) lib/cancan/model_adapters/abstract_adapter.rb:20:in `find'
      cancancan (1.13.1) lib/cancan/controller_resource.rb:111:in `find_resource'
      cancancan (1.13.1) lib/cancan/controller_resource.rb:63:in `load_resource_instance'
      cancancan (1.13.1) lib/cancan/controller_resource.rb:32:in `load_resource'
      cancancan (1.13.1) lib/cancan/controller_resource.rb:25:in `load_and_authorize_resource'
      cancancan (1.13.1) lib/cancan/controller_resource.rb:10:in `block in add_before_filter'
      activesupport (4.2.5.1) lib/active_support/callbacks.rb:448:in `instance_exec'
      activesupport (4.2.5.1) lib/active_support/callbacks.rb:448:in `block in make_lambda'
      activesupport (4.2.5.1) lib/active_support/callbacks.rb:164:in `call'
      activesupport (4.2.5.1) lib/active_support/callbacks.rb:164:in `block in halting'
      activesupport (4.2.5.1) lib/active_support/callbacks.rb:504:in `call'
      activesupport (4.2.5.1) lib/active_support/callbacks.rb:504:in `block in call'
      activesupport (4.2.5.1) lib/active_support/callbacks.rb:504:in `each'
      activesupport (4.2.5.1) lib/active_support/callbacks.rb:504:in `call'
      activesupport (4.2.5.1) lib/active_support/callbacks.rb:92:in `__run_callbacks__'
      activesupport (4.2.5.1) lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
      activesupport (4.2.5.1) lib/active_support/callbacks.rb:81:in `run_callbacks'
      actionpack (4.2.5.1) lib/abstract_controller/callbacks.rb:19:in `process_action'
      actionpack (4.2.5.1) lib/action_controller/metal/rescue.rb:29:in `process_action'
      actionpack (4.2.5.1) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
      activesupport (4.2.5.1) lib/active_support/notifications.rb:164:in `block in instrument'
      activesupport (4.2.5.1) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
      activesupport (4.2.5.1) lib/active_support/notifications.rb:164:in `instrument'
      actionpack (4.2.5.1) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
      actionpack (4.2.5.1) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
      activerecord (4.2.5.1) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
      actionpack (4.2.5.1) lib/abstract_controller/base.rb:137:in `process'
      actionview (4.2.5.1) lib/action_view/rendering.rb:30:in `process'
      actionpack (4.2.5.1) lib/action_controller/metal.rb:196:in `dispatch'
      actionpack (4.2.5.1) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
      actionpack (4.2.5.1) lib/action_controller/metal.rb:237:in `block in action'
      actionpack (4.2.5.1) lib/action_dispatch/routing/route_set.rb:74:in `call'
      actionpack (4.2.5.1) lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
      actionpack (4.2.5.1) lib/action_dispatch/routing/route_set.rb:43:in `serve'
      actionpack (4.2.5.1) lib/action_dispatch/journey/router.rb:43:in `block in serve'
      actionpack (4.2.5.1) lib/action_dispatch/journey/router.rb:30:in `each'
      actionpack (4.2.5.1) lib/action_dispatch/journey/router.rb:30:in `serve'
      actionpack (4.2.5.1) lib/action_dispatch/routing/route_set.rb:815:in `call'
      warden (1.2.6) lib/warden/manager.rb:35:in `block in call'
      warden (1.2.6) lib/warden/manager.rb:34:in `catch'
      warden (1.2.6) lib/warden/manager.rb:34:in `call'
      rack (1.6.4) lib/rack/etag.rb:24:in `call'
      rack (1.6.4) lib/rack/conditionalget.rb:25:in `call'
      rack (1.6.4) lib/rack/head.rb:13:in `call'
      actionpack (4.2.5.1) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
      actionpack (4.2.5.1) lib/action_dispatch/middleware/flash.rb:260:in `call'
      rack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context'
      rack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call'
      actionpack (4.2.5.1) lib/action_dispatch/middleware/cookies.rb:560:in `call'
      activerecord (4.2.5.1) lib/active_record/query_cache.rb:36:in `call'
      activerecord (4.2.5.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
      activerecord (4.2.5.1) lib/active_record/migration.rb:377:in `call'
      actionpack (4.2.5.1) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
      activesupport (4.2.5.1) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
      activesupport (4.2.5.1) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
      activesupport (4.2.5.1) lib/active_support/callbacks.rb:81:in `run_callbacks'
      actionpack (4.2.5.1) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
      actionpack (4.2.5.1) lib/action_dispatch/middleware/reloader.rb:73:in `call'
      actionpack (4.2.5.1) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
      actionpack (4.2.5.1) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
      web-console (2.3.0) lib/web_console/middleware.rb:28:in `block in call'
      web-console (2.3.0) lib/web_console/middleware.rb:18:in `catch'
      web-console (2.3.0) lib/web_console/middleware.rb:18:in `call'
      actionpack (4.2.5.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
      railties (4.2.5.1) lib/rails/rack/logger.rb:38:in `call_app'
      railties (4.2.5.1) lib/rails/rack/logger.rb:20:in `block in call'
      activesupport (4.2.5.1) lib/active_support/tagged_logging.rb:68:in `block in tagged'
      activesupport (4.2.5.1) lib/active_support/tagged_logging.rb:26:in `tagged'
      activesupport (4.2.5.1) lib/active_support/tagged_logging.rb:68:in `tagged'
      railties (4.2.5.1) lib/rails/rack/logger.rb:20:in `call'
      actionpack (4.2.5.1) lib/action_dispatch/middleware/request_id.rb:21:in `call'
      rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
      rack (1.6.4) lib/rack/runtime.rb:18:in `call'
      activesupport (4.2.5.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
      rack (1.6.4) lib/rack/lock.rb:17:in `call'
      actionpack (4.2.5.1) lib/action_dispatch/middleware/static.rb:116:in `call'
      rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
      railties (4.2.5.1) lib/rails/engine.rb:518:in `call'
      railties (4.2.5.1) lib/rails/application.rb:165:in `call'
      rack (1.6.4) lib/rack/lock.rb:17:in `call'
      rack (1.6.4) lib/rack/content_length.rb:15:in `call'
      rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
      /home/moshenglong/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
      /home/moshenglong/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
      /home/moshenglong/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
    
    
      Rendered /home/moshenglong/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/templates/rescues/_source.erb (4.8ms)
      Rendered /home/moshenglong/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.5ms)
      Rendered /home/moshenglong/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (0.7ms)
      Rendered /home/moshenglong/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (15.9ms)
      Rendered /home/moshenglong/.rvm/gems/ruby-2.0.0-p643/gems/web-console-2.3.0/lib/web_console/templates/_markup.html.erb (0.5ms)
      Rendered /home/moshenglong/.rvm/gems/ruby-2.0.0-p643/gems/web-console-2.3.0/lib/web_console/templates/_inner_console_markup.html.erb within layouts/inlined_string (0.3ms)
      Rendered /home/moshenglong/.rvm/gems/ruby-2.0.0-p643/gems/web-console-2.3.0/lib/web_console/templates/_prompt_box_markup.html.erb within layouts/inlined_string (0.4ms)
      Rendered /home/moshenglong/.rvm/gems/ruby-2.0.0-p643/gems/web-console-2.3.0/lib/web_console/templates/style.css.erb within layouts/inlined_string (0.4ms)
      Rendered /home/moshenglong/.rvm/gems/ruby-2.0.0-p643/gems/web-console-2.3.0/lib/web_console/templates/console.js.erb within layouts/javascript (13.6ms)
      Rendered /home/moshenglong/.rvm/gems/ruby-2.0.0-p643/gems/web-console-2.3.0/lib/web_console/templates/main.js.erb within layouts/javascript (0.4ms)
      Rendered /home/moshenglong/.rvm/gems/ruby-2.0.0-p643/gems/web-console-2.3.0/lib/web_console/templates/error_page.js.erb within layouts/javascript (0.3ms)
      Rendered /home/moshenglong/.rvm/gems/ruby-2.0.0-p643/gems/web-console-2.3.0/lib/web_console/templates/index.html.erb (27.1ms)
    

    这是所有的 bash 里面所有的错误信息了,还是不知道如何解决

  • 再顶下

  • 给初学者推荐一本书 at 2016年04月04日

    不过我们还有 4 楼的头像

  • #4 楼 @huacnlee 直接 super,莫非 devise 可以有保存头像的功能?

  • #1 楼 @775343518 CarrierWave 吗?

  • 看来我看的源码过时了。。。

  • #1 楼 @hww 原来如此,谢谢了~

  • 话说我大哥也老是劝我看英语文档...慢慢适应看英语吧

  • Ruby 服务器部署问题 at 2016年03月02日

    同遇到这个问题,顶一个