0
我的活动管理版本是0.3.0,除了m也使用'Will_paginate'我做了kaminari和will_paginate之间的冲突配置设置,但仍然得到这个错误。我不知道其中m犯错一切正常为其他模式,但不适合这种模式,需要帮助,我已经搜索也发现了一些联系,但没有得到满意的答复,它给我的错误上粗线未定义的方法`页'为#<阵列:0xbc0ff98>
ActiveAdmin.register User do
menu :parent => 'Reports'
filter :id
filter :user_id
filter :updated_at
# and other filters
scope :all, :default => true do |user|
User.all
end
scope :active do |user|
User.where("user.status = ?", 'actvie')
end
scope :rejected do |user|
User.where("user.status = ?", 'non_active')
end
actions :index, :show
index do
column "ID" do |u|
link_to u.id, cs_user_path(u)
end
column "Status" do |u|
status_tag(u.status)
end
column "User" do |u|
link_to(u.user.full_name, cs_user_path(u.user)) rescue nil
end
end
collection_action :index, :method => :get do
scope = User.includes([:group,:address]).scoped
scope = scope.order params[:order].gsub(/_/,' ') if params[:order]
@collection = scope.paginate(:per_page => 25,:page => params[:page]) if params[:q].blank?
@search = scope.metasearch(clean_search_params(params[:q]))
**super do |format|**
format.html {
render "active_admin/resource/index"
}
end
end
end
有人请回答我已经从过去2小时被阻塞 –
我已经解决了这个问题,问题是,User.all返回一个数组,并且will_paginate不能在数组上工作,为了解决它,只需替换User。所有与User.order('id DESC'),以便它将返回活动的记录关系,谢谢你的赞赏 –