ruby-on-rails - Rails 4.0.1 和 HAML 中的 `undefined method ` [] ' for nil:NilClass`

标签 ruby-on-rails activerecord haml

编辑#2:我刚刚从 4.0.1 降级回 Rails 4.0.0,它解决了问题...如果有人知道是什么原因造成的,以及如何安全地升级到 4.0 .1,请告诉我。或者这可能是应该报告的 4.0.1 或 HAML 问题?我不知道该向哪里报告...


我的 HAML View ,昨天运行良好,我没有改变,不知何故不再运行。

观点:

1 =form_for @document do |f|
2
3  =f.text_field :title, placeholder: "Title"
4
5  =f.text_field :slug, placeholder: "URL slug"
6
7  ... and more

以及它从第 1 行抛出的错误:

undefined method `[]' for nil:NilClass

@document 在 Controller 中被实例化为 Document.new。就像我说的,这段代码昨天运行良好,我没有更改 View 或 Controller 。我今天从 Rails 4.0.0 升级到 4.0.1 - 这可能是罪魁祸首吗?

我的Gemfile.lock:

GIT
  remote: git://github.com/adzap/active_enum.git
  revision: 280548e3954d8f9e032968dd2757b7e5862cdf49
  specs:
    active_enum (0.9.12)
      activesupport (>= 3.0)

GIT

  remote: git://github.com/sporkrb/spork-rails.git
  revision: 0dd45e59d3237b4c8f9efc215b46d9c07072a95e
  specs:
    spork-rails (4.0.0)
      rails (>= 3.0.0, < 5)
      spork (>= 1.0rc0)

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (4.0.1)
      actionpack (= 4.0.1)
      mail (~> 2.5.4)
    actionpack (4.0.1)
      activesupport (= 4.0.1)
      builder (~> 3.1.0)
      erubis (~> 2.7.0)
      rack (~> 1.5.2)
      rack-test (~> 0.6.2)
    active_model_serializers (0.8.1)
      activemodel (>= 3.0)
    activemodel (4.0.1)
      activesupport (= 4.0.1)
      builder (~> 3.1.0)
    activerecord (4.0.1)
      activemodel (= 4.0.1)
      activerecord-deprecated_finders (~> 1.0.2)
      activesupport (= 4.0.1)
      arel (~> 4.0.0)
    activerecord-deprecated_finders (1.0.3)
    activesupport (4.0.1)
      i18n (~> 0.6, >= 0.6.4)
      minitest (~> 4.2)
      multi_json (~> 1.3)
      thread_safe (~> 0.1)
      tzinfo (~> 0.3.37)
    annotate (2.5.0)
      rake
    ansi (1.4.3)
    arel (4.0.1)
    atomic (1.1.14)
    aws-sdk (1.22.1)
      json (~> 1.4)
      nokogiri (>= 1.4.4, < 1.6.0)
      uuidtools (~> 2.1)
    bcrypt-ruby (3.1.2)
    bootstrap-sass (2.3.1.0)
      sass (~> 3.2)
    builder (3.1.4)
    capybara (2.1.0)
      mime-types (>= 1.16)
      nokogiri (>= 1.3.3)
      rack (>= 1.0.0)
      rack-test (>= 0.5.4)
      xpath (~> 2.0)
    capybara-webkit (1.0.0)
      capybara (~> 2.0, >= 2.0.2)
      json
    celluloid (0.15.2)
      timers (~> 1.1.0)
    childprocess (0.3.9)
      ffi (~> 1.0, >= 1.0.11)
    climate_control (0.0.3)
      activesupport (>= 3.0)
    cocaine (0.5.2)
      climate_control (>= 0.0.3, < 1.0)
    coderay (1.0.9)
    coffee-rails (4.0.0)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0.beta, < 5.0)
    coffee-script (2.2.0)
      coffee-script-source
      execjs
    coffee-script-source (1.5.0)
    columnize (0.3.6)
    database_cleaner (1.1.1)
    debugger (1.6.2)
      columnize (>= 0.3.1)
      debugger-linecache (~> 1.2.0)
      debugger-ruby_core_source (~> 1.2.3)
    debugger-linecache (1.2.0)
    debugger-ruby_core_source (1.2.3)
    devise (3.1.1)
      bcrypt-ruby (~> 3.0)
      orm_adapter (~> 0.1)
      railties (>= 3.2.6, < 5)
      thread_safe (~> 0.1)
      warden (~> 1.2.3)
    diff-lcs (1.2.4)
    dropbox-sdk (1.6.1)
      json
    erubis (2.7.0)
    ethon (0.5.12)
      ffi (>= 1.3.0)
      mime-types (~> 1.18)
    execjs (1.4.0)
      multi_json (~> 1.0)
    factory_girl (4.1.0)
      activesupport (>= 3.0.0)
    factory_girl_rails (4.1.0)
      factory_girl (~> 4.1.0)
      railties (>= 3.0.0)
    faker (1.2.0)
      i18n (~> 0.5)
    fakeweb (1.3.0)
    faraday (0.8.8)
      multipart-post (~> 1.2.0)
    ffi (1.9.0)
    figaro (0.7.0)
      bundler (~> 1.0)
      rails (>= 3, < 5)
    font-awesome-sass-rails (3.0.2.2)
      railties (>= 3.1.1)
      sass-rails (>= 3.1.1)
    formatador (0.2.4)
    guard (2.0.5)
      formatador (>= 0.2.4)
      listen (~> 2.0)
      lumberjack (~> 1.0)
      pry (>= 0.9.12)
      thor (>= 0.18.1)
    guard-rspec (1.2.1)
      guard (>= 1.1)
    guard-spork (1.5.1)
      childprocess (>= 0.2.3)
      guard (>= 1.1)
      spork (>= 0.8.4)
    haml (4.0.4)
      tilt
    hashie (2.0.5)
    hashr (0.0.22)
    hike (1.2.3)
    httpauth (0.2.0)
    i18n (0.6.5)
    jquery-rails (3.0.1)
      railties (>= 3.0, < 5.0)
      thor (>= 0.14, < 2.0)
    json (1.8.0)
    jwt (0.1.8)
      multi_json (>= 1.5)
    libv8 (3.16.14.3)
    listen (2.1.0)
      celluloid (>= 0.15.2)
      rb-fsevent (>= 0.9.3)
      rb-inotify (>= 0.9)
    lumberjack (1.0.4)
    mail (2.5.4)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    method_source (0.8.2)
    mime-types (1.25.1)
    minitest (4.7.5)
    multi_json (1.8.2)
    multipart-post (1.2.0)
    nokogiri (1.5.9)
    oauth2 (0.8.1)
      faraday (~> 0.8)
      httpauth (~> 0.1)
      jwt (~> 0.1.4)
      multi_json (~> 1.0)
      rack (~> 1.2)
    omniauth (1.1.4)
      hashie (>= 1.2, < 3)
      rack
    omniauth-github (1.1.0)
      omniauth (~> 1.0)
      omniauth-oauth2 (~> 1.1)
    omniauth-oauth2 (1.1.1)
      oauth2 (~> 0.8.0)
      omniauth (~> 1.0)
    orm_adapter (0.4.0)
    paperclip (3.5.1)
      activemodel (>= 3.0.0)
      activesupport (>= 3.0.0)
      cocaine (~> 0.5.0)
      mime-types
    pg (0.15.1)
    polyglot (0.3.3)
    protected_attributes (1.0.3)
      activemodel (>= 4.0.0, < 5.0)
    pry (0.9.12.2)
      coderay (~> 1.0.5)
      method_source (~> 0.8)
      slop (~> 3.4)
    rack (1.5.2)
    rack-test (0.6.2)
      rack (>= 1.0)
    rails (4.0.1)
      actionmailer (= 4.0.1)
      actionpack (= 4.0.1)
      activerecord (= 4.0.1)
      activesupport (= 4.0.1)
      bundler (>= 1.3.0, < 2.0)
      railties (= 4.0.1)
      sprockets-rails (~> 2.0.0)
    rails_12factor (0.0.2)
      rails_serve_static_assets
      rails_stdout_logging
    rails_serve_static_assets (0.0.1)
    rails_stdout_logging (0.0.3)
    railties (4.0.1)
      actionpack (= 4.0.1)
      activesupport (= 4.0.1)
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    rake (10.1.0)
    rb-fsevent (0.9.3)
    rb-inotify (0.9.2)
      ffi (>= 0.5.0)
    ref (1.0.5)
    rest-client (1.6.7)
      mime-types (>= 1.16)
    rspec-core (2.14.7)
    rspec-expectations (2.14.3)
      diff-lcs (>= 1.1.3, < 2.0)
    rspec-mocks (2.14.3)
    rspec-rails (2.14.0)
      actionpack (>= 3.0)
      activesupport (>= 3.0)
      railties (>= 3.0)
      rspec-core (~> 2.14.0)
      rspec-expectations (~> 2.14.0)
      rspec-mocks (~> 2.14.0)
    sass (3.2.12)
    sass-rails (4.0.0)
      railties (>= 4.0.0.beta, < 5.0)
      sass (>= 3.1.10)
      sprockets-rails (~> 2.0.0)
    slop (3.4.6)
    spork (1.0.0rc4)
    sprockets (2.10.1)
      hike (~> 1.2)
      multi_json (~> 1.0)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    sprockets-rails (2.0.1)
      actionpack (>= 3.0)
      activesupport (>= 3.0)
      sprockets (~> 2.8)
    therubyracer (0.12.0)
      libv8 (~> 3.16.14.0)
      ref
    thor (0.18.1)
    thread_safe (0.1.3)
      atomic
    tilt (1.4.1)
    timers (1.1.0)
    tire (0.6.1)
      activemodel (>= 3.0)
      activesupport
      ansi
      hashr (~> 0.0.19)
      multi_json (~> 1.3)
      rake
      rest-client (~> 1.6)
    treetop (1.4.15)
      polyglot
      polyglot (>= 0.3.1)
    typhoeus (0.6.3)
      ethon (~> 0.5.11)
    tzinfo (0.3.38)
    uglifier (2.2.1)
      execjs (>= 0.3.0)
      multi_json (~> 1.0, >= 1.0.2)
    uuidtools (2.1.4)
    vcr (2.5.0)
    warden (1.2.3)
      rack (>= 1.0)
    xpath (2.0.0)
      nokogiri (~> 1.3)

PLATFORMS
  ruby

DEPENDENCIES
  active_enum!
  active_model_serializers
  annotate (= 2.5.0)
  aws-sdk
  bootstrap-sass (= 2.3.1.0)
  capybara (= 2.1.0)
  capybara-webkit (= 1.0.0)
  childprocess (= 0.3.9)
  coffee-rails (= 4.0.0)
  coffee-script-source (= 1.5.0)
  database_cleaner (~> 1.1.1)
  debugger
  devise (= 3.1.1)
  dropbox-sdk (= 1.6.1)
  execjs (= 1.4.0)
  factory_girl_rails (= 4.1.0)
  faker (~> 1.2.0)
  fakeweb (= 1.3.0)
  figaro (= 0.7.0)
  font-awesome-sass-rails (= 3.0.2.2)
  guard-rspec (= 1.2.1)
  guard-spork (= 1.5.1)
  haml
  jquery-rails (= 3.0.1)
  json (= 1.8.0)
  nokogiri (= 1.5.9)
  omniauth (= 1.1.4)
  omniauth-github (= 1.1.0)
  paperclip
  pg (= 0.15.1)
  protected_attributes
  rails (= 4.0.1)
  rails_12factor
  rspec-mocks
  rspec-rails
  sass-rails
  spork-rails!
  therubyracer (= 0.12.0)
  tire
  typhoeus (= 0.6.3)
  uglifier (>= 1.0.3)
  vcr (= 2.5.0)

另外,我刚刚注意到,当我加载 Rails 控制台时,当我在 any ActiveRecord 模型上调用 .new 时出现以下错误: 对象不支持#inspect。这两个错误可能相关吗?怎么回事?

编辑:根据要求,这是完整的错误跟踪:

activerecord (4.0.1) lib/active_record/attribute_methods/read.rb:86:in `block in read_attribute'
activerecord (4.0.1) lib/active_record/attribute_methods/read.rb:84:in `fetch'
activerecord (4.0.1) lib/active_record/attribute_methods/read.rb:84:in `read_attribute'
activerecord (4.0.1) lib/active_record/attribute_methods/read.rb:59:in `__temp__9646'
activerecord (4.0.1) lib/active_record/attribute_methods/primary_key.rb:12:in `to_key'
actionpack (4.0.1) lib/action_view/record_identifier.rb:80:in `record_key_for_dom_id'
actionpack (4.0.1) lib/action_view/record_identifier.rb:62:in `dom_id'
actionpack (4.0.1) lib/action_view/helpers/form_helper.rb:448:in `apply_form_for_options!'
actionpack (4.0.1) lib/action_view/helpers/form_helper.rb:426:in `form_for'
haml (4.0.4) lib/haml/helpers/action_view_mods.rb:146:in `form_for_with_haml'
haml (4.0.4) lib/haml/helpers/action_view_xss_mods.rb:28:in `form_for_with_haml_xss'
app/views/documents/_form.html.haml:1:in `_app_views_documents__form_html_haml___2743923910659809414_70104327049600'
actionpack (4.0.1) lib/action_view/template.rb:143:in `block in render'
activesupport (4.0.1) lib/active_support/notifications.rb:161:in `instrument'
actionpack (4.0.1) lib/action_view/template.rb:141:in `render'
actionpack (4.0.1) lib/action_view/renderer/partial_renderer.rb:306:in `render_partial'
actionpack (4.0.1) lib/action_view/renderer/partial_renderer.rb:279:in `block in render'
actionpack (4.0.1) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
activesupport (4.0.1) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.0.1) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.0.1) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.0.1) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
actionpack (4.0.1) lib/action_view/renderer/partial_renderer.rb:278:in `render'
actionpack (4.0.1) lib/action_view/renderer/renderer.rb:47:in `render_partial'
actionpack (4.0.1) lib/action_view/helpers/rendering_helper.rb:27:in `render'
haml (4.0.4) lib/haml/helpers/action_view_mods.rb:10:in `block in render_with_haml'
haml (4.0.4) lib/haml/helpers.rb:89:in `non_haml'
haml (4.0.4) lib/haml/helpers/action_view_mods.rb:10:in `render_with_haml'
app/views/documents/new.html.haml:5:in `_app_views_documents_new_html_haml___1017140852746329293_70104326917800'
actionpack (4.0.1) lib/action_view/template.rb:143:in `block in render'
activesupport (4.0.1) lib/active_support/notifications.rb:161:in `instrument'
actionpack (4.0.1) lib/action_view/template.rb:141:in `render'
actionpack (4.0.1) lib/action_view/renderer/template_renderer.rb:49:in `block (2 levels) in render_template'
actionpack (4.0.1) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
activesupport (4.0.1) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.0.1) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.0.1) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.0.1) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
actionpack (4.0.1) lib/action_view/renderer/template_renderer.rb:48:in `block in render_template'
actionpack (4.0.1) lib/action_view/renderer/template_renderer.rb:56:in `render_with_layout'
actionpack (4.0.1) lib/action_view/renderer/template_renderer.rb:47:in `render_template'
actionpack (4.0.1) lib/action_view/renderer/template_renderer.rb:17:in `render'
actionpack (4.0.1) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionpack (4.0.1) lib/action_view/renderer/renderer.rb:23:in `render'
actionpack (4.0.1) lib/abstract_controller/rendering.rb:127:in `_render_template'
actionpack (4.0.1) lib/action_controller/metal/streaming.rb:219:in `_render_template'
actionpack (4.0.1) lib/abstract_controller/rendering.rb:120:in `render_to_body'
actionpack (4.0.1) lib/action_controller/metal/rendering.rb:33:in `render_to_body'
actionpack (4.0.1) lib/action_controller/metal/renderers.rb:26:in `render_to_body'
actionpack (4.0.1) lib/abstract_controller/rendering.rb:97:in `render'
actionpack (4.0.1) lib/action_controller/metal/rendering.rb:16:in `render'
actionpack (4.0.1) lib/action_controller/metal/instrumentation.rb:41:in `block (2 levels) in render'
activesupport (4.0.1) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
/Users/george/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/benchmark.rb:296:in `realtime'
activesupport (4.0.1) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (4.0.1) lib/action_controller/metal/instrumentation.rb:41:in `block in render'
actionpack (4.0.1) lib/action_controller/metal/instrumentation.rb:84:in `cleanup_view_runtime'
activerecord (4.0.1) lib/active_record/railties/controller_runtime.rb:25:in `cleanup_view_runtime'
actionpack (4.0.1) lib/action_controller/metal/instrumentation.rb:40:in `render'
actionpack (4.0.1) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
actionpack (4.0.1) lib/action_controller/metal/implicit_render.rb:5:in `send_action'
actionpack (4.0.1) lib/abstract_controller/base.rb:189:in `process_action'
actionpack (4.0.1) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.0.1) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (4.0.1) lib/active_support/callbacks.rb:403:in `_run__4420817618306697940__process_action__callbacks'
activesupport (4.0.1) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.1) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (4.0.1) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.0.1) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
activesupport (4.0.1) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.0.1) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.0.1) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.0.1) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.0.1) lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
activerecord (4.0.1) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.0.1) lib/abstract_controller/base.rb:136:in `process'
actionpack (4.0.1) lib/abstract_controller/rendering.rb:44:in `process'
actionpack (4.0.1) lib/action_controller/metal.rb:195:in `dispatch'
actionpack (4.0.1) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.0.1) lib/action_controller/metal.rb:231:in `block in action'
actionpack (4.0.1) lib/action_dispatch/routing/route_set.rb:80:in `call'
actionpack (4.0.1) lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
actionpack (4.0.1) lib/action_dispatch/routing/route_set.rb:48:in `call'
actionpack (4.0.1) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.0.1) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.0.1) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.0.1) lib/action_dispatch/routing/route_set.rb:680:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
actionpack (4.0.1) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.0.1) lib/action_dispatch/middleware/flash.rb:241:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.0.1) lib/action_dispatch/middleware/cookies.rb:486:in `call'
activerecord (4.0.1) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.0.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
actionpack (4.0.1) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.0.1) lib/active_support/callbacks.rb:373:in `_run__3348029417397685055__call__callbacks'
activesupport (4.0.1) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.1) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.0.1) lib/action_dispatch/middleware/reloader.rb:64:in `call'
actionpack (4.0.1) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
actionpack (4.0.1) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.0.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.1) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.1) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.0.1) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.1) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.1) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.1) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.0.1) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.1) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.0.1) lib/action_dispatch/middleware/static.rb:64:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
railties (4.0.1) lib/rails/engine.rb:511:in `call'
railties (4.0.1) lib/rails/application.rb:97:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
/Users/george/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
/Users/george/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
/Users/george/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'

最佳答案

看起来它与 protected_attributes gem 的版本有关,它与 rails 4.0.1 交互不利。尝试升级到 protected_attributes 1.0.5。

https://github.com/thoughtbot/factory_girl_rails/issues/115

关于ruby-on-rails - Rails 4.0.1 和 HAML 中的 `undefined method ` [] ' for nil:NilClass`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20237364/

相关文章:

javascript - Select2 提交值而不是 id

ruby-on-rails - 销售人员 REST API : Databasedotcom gem to upload attachments

ruby-on-rails - 如何处理 Ruby on Rails 错误 : "Please install the postgresql adapter: ` gem install activerecord-postgresql-adapter'"

ruby-on-rails - 非法嵌套 : nesting within plain text is illegal

css - Haml:如何设置动态类值?

ruby-on-rails - 通过关系和构建调用使用 has_many 形成 Rails 嵌套模型

mysql - 如何在 Rails 中使用 MySQL 的 REPLACE 语法

ruby - 如何拥有允许重复的有序模型关联

mysql - Rails 相当于 SQL 查询的事件记录查询

Javascript 仅适用于页面上的某些位置