在狂欢管理员,没有加载的分类说“搜索”

问题描述 投票:0回答:1

在我的后台使用spree的ruby应用程序中,我无法在产品中添加分类。

它显示加载失败... enter image description here

enter image description here

Error: Failed to load resource: the server responded with a status of 
422 (Unprocessable Entity)
:3000/api/taxons?per_page=50&page=1&without_children=true&q%5Bname_cont%5D=&token=477cdac328120d8a3dcb804358ec4535091366faf9e988f3&_=1517890528589

我已经尝试重新生成API密钥。但没有解决问题。

请帮我解决这个问题。

ruby-on-rails ruby rubygems spree
1个回答
0
投票

修复了这个问题。由于'will_paginate'宝石出现了问题。通过替换config / initializers / will_paginate.rb

 if defined?(WillPaginate)
  module WillPaginate
  module ActiveRecord
   module RelationMethods
   def per_page(num)
    if (n = num.to_i) <= 0
      self
     else
      limit(n).offset(offset_value / limit_value * n)
    end
   end

def total_pages
  (total_count.to_f / limit_value).ceil
end

alias_method :per, :per_page
alias_method :num_pages, :total_pages
alias_method :total_count, :total_entries
  end
 end

结束`

© www.soinside.com 2019 - 2024. All rights reserved.