Ruby on rails 更新到Rails 5后出现“参数数量错误”

Ruby on rails 更新到Rails 5后出现“参数数量错误”,ruby-on-rails,ruby,ruby-on-rails-5,wice-grid,Ruby On Rails,Ruby,Ruby On Rails 5,Wice Grid,我使用gem和下面的代码。这适用于Rails 4.2.6,但在更新到Rails 5.0.0后,给出的错误参数数量为0,预期为1。有人知道怎么解决这个问题吗 <%= grid(@acodes_grid, show_filters: :when_filtered, html: {class: 'my-grid'}) do |g| g.column name: 'ID', attribute: 'id', auto_reload: true, html: {id: 'grid-cells'}

我使用gem和下面的代码。这适用于Rails 4.2.6,但在更新到Rails 5.0.0后,给出的错误参数数量为0,预期为1。有人知道怎么解决这个问题吗

<%= grid(@acodes_grid, show_filters: :when_filtered, html: {class: 'my-grid'}) do |g|
  g.column name: 'ID', attribute: 'id', auto_reload: true, html: {id: 'grid-cells'}
  etc.
end %>
回溯不要认为合并!有关警告:

Processing by AcodesController#index as HTML
  User Load (0.9ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."username" ASC LIMIT $2  [["id", 101], ["LIMIT", 1]]
  Rendering acodes/index.html.erb within layouts/application
DEPRECATION WARNING: Method merge! is deprecated and will be removed in Rails 5.1, as `ActionController::Parameters` no longer inherits from hash. Using this deprecated behavior exposes potential security problems. If you continue to use this method you may be creating a security vulnerability in your app that can be exploited. Instead, consider using one of these documented methods which are not deprecated: http://api.rubyonrails.org/v5.0.0/classes/ActionController/Parameters.html (called from _app_views_acodes_index_html_erb__2623538288025501826_69831314588840 at /home/ubuntu/workspace/***/app/views/acodes/index.html.erb:9)
  Rendered acodes/index.html.erb within layouts/application (427.2ms)
Completed 500 Internal Server Error in 476ms (ActiveRecord: 4.2ms)

ActionView::Template::Error (wrong number of arguments (given 0, expected 1)):
     6: 
     7:       <div class="now1">Codes</div>
     8:       
     9:       <%= grid(@acodes_grid, show_filters: :when_filtered, html: {class: 'my-grid'}) do |g|
    10:         g.column name: 'ID', attribute: 'id', auto_reload: true, html: {id: 'grid-cells'}
    11:         g.column attribute: 'avatar', html: {id: 'grid-cells'} do |acode|
    12:           image_tag(acode.avatar.url, style: "max-height: 30px; max-width: 30px") if acode.avatar?

app/views/acodes/index.html.erb:9:in `_app_views_acodes_index_html_erb__2623538288025501826_69831314588840'
  Rendering /usr/local/rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb within rescues/layout
  Rendering /usr/local/rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0/lib/action_dispatch/middleware/templates/rescues/_source.html.erb
  Rendered /usr/local/rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0/lib/action_dispatch/middleware/templates/rescues/_source.html.erb (4.7ms)
  Rendering /usr/local/rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
  Rendered /usr/local/rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.8ms)
  Rendering /usr/local/rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb
  Rendered /usr/local/rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.1ms)
  Rendered /usr/local/rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb within rescues/layout (86.6ms)

请添加错误的回溯。谢谢,添加到那些行之外有意义的OPAnything?它们看起来像是来自错误处理操作,而不是原始操作。看起来gem还不支持rails5:@NicNilov,除了这些行之外什么都没有。谢谢FredWillmore,我想这一定是问题的原因。请添加错误的回溯。谢谢,添加到那些行之外的有意义的OPAnything?它们看起来像是来自错误处理操作,而不是原始操作。看起来gem还不支持rails5:@NicNilov,除了这些行之外什么都没有。谢谢你,我想这一定是问题的原因。
Processing by AcodesController#index as HTML
  User Load (0.9ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."username" ASC LIMIT $2  [["id", 101], ["LIMIT", 1]]
  Rendering acodes/index.html.erb within layouts/application
DEPRECATION WARNING: Method merge! is deprecated and will be removed in Rails 5.1, as `ActionController::Parameters` no longer inherits from hash. Using this deprecated behavior exposes potential security problems. If you continue to use this method you may be creating a security vulnerability in your app that can be exploited. Instead, consider using one of these documented methods which are not deprecated: http://api.rubyonrails.org/v5.0.0/classes/ActionController/Parameters.html (called from _app_views_acodes_index_html_erb__2623538288025501826_69831314588840 at /home/ubuntu/workspace/***/app/views/acodes/index.html.erb:9)
  Rendered acodes/index.html.erb within layouts/application (427.2ms)
Completed 500 Internal Server Error in 476ms (ActiveRecord: 4.2ms)

ActionView::Template::Error (wrong number of arguments (given 0, expected 1)):
     6: 
     7:       <div class="now1">Codes</div>
     8:       
     9:       <%= grid(@acodes_grid, show_filters: :when_filtered, html: {class: 'my-grid'}) do |g|
    10:         g.column name: 'ID', attribute: 'id', auto_reload: true, html: {id: 'grid-cells'}
    11:         g.column attribute: 'avatar', html: {id: 'grid-cells'} do |acode|
    12:           image_tag(acode.avatar.url, style: "max-height: 30px; max-width: 30px") if acode.avatar?

app/views/acodes/index.html.erb:9:in `_app_views_acodes_index_html_erb__2623538288025501826_69831314588840'
  Rendering /usr/local/rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb within rescues/layout
  Rendering /usr/local/rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0/lib/action_dispatch/middleware/templates/rescues/_source.html.erb
  Rendered /usr/local/rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0/lib/action_dispatch/middleware/templates/rescues/_source.html.erb (4.7ms)
  Rendering /usr/local/rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
  Rendered /usr/local/rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.8ms)
  Rendering /usr/local/rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb
  Rendered /usr/local/rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.1ms)
  Rendered /usr/local/rvm/gems/ruby-2.3.1/gems/actionpack-5.0.0/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb within rescues/layout (86.6ms)