Devise 获取未定义的方法'user_id';在活动管理中

Devise 获取未定义的方法'user_id';在活动管理中,devise,ruby-on-rails-3.2,activeadmin,Devise,Ruby On Rails 3.2,Activeadmin,嘿,我正在为与我的用户模型相关的活动管理设置而挣扎。我用的是Desive 当我在active admin中单击用户选项卡时,我得到: NoMethodError in Admin/users#index Showing /Users/bweidlich/.rvm/gems/ruby-1.9.3-p286/gems/activeadmin- 0.5.1/app/views/active_admin/resource/index.html.arb where line #1 raised:

嘿,我正在为与我的用户模型相关的活动管理设置而挣扎。我用的是Desive

当我在active admin中单击用户选项卡时,我得到:

NoMethodError in Admin/users#index

Showing /Users/bweidlich/.rvm/gems/ruby-1.9.3-p286/gems/activeadmin-   0.5.1/app/views/active_admin/resource/index.html.arb where line #1 raised:

undefined method `user_id_contains' for #<MetaSearch::Searches::User:0x007fc0a9831cf8>
Extracted source (around line #1):

1: insert_tag renderer_for(:index)
用户表模式

# == Schema Information
#
# Table name: users
#
#  id                     :integer          not null, primary key
#  email                  :string(255)
#  encrypted_password     :string(255)
#  reset_password_token   :string(255)
#  reset_password_sent_at :datetime
#  remember_created_at    :datetime
#  sign_in_count          :integer
#  current_sign_in_at     :datetime
#  last_sign_in_at        :datetime
#  current_sign_in_ip     :string(255)
#  last_sign_in_ip        :string(255)
#  created_at             :datetime
#  updated_at             :datetime
#  username               :string(255)
#  bio                    :text
#  title                  :string(255)
#  company                :string(255)
#  facebook               :text
#  twitter                :text
#  pinterest              :text
#  linkedin               :text
#  confirmation_token     :string(255)
#  confirmed_at           :datetime
#  confirmation_sent_at   :datetime
#  unconfirmed_email      :string(255)
#  first_name             :string(255)
#  last_name              :string(255)
#  avatar                 :string(255)
#  avatar_id              :integer
#

也许它正在用户表中查找一个名为user_id的列?请从app/models/user.rb和admin/users.rb文件中粘贴代码,好吗?还有用户表模式?我用代码和模式更新了我的问题。谢谢你们的调查,伙计们!同样的问题,你解决了吗?
class User < ActiveRecord::Base
  rolify
  devise :database_authenticatable, :registerable,
     :recoverable, :rememberable, :trackable, :validatable,
     :confirmable

  attr_accessible :role_ids, :as => :admin
  attr_accessible :username, :first_name, :last_name, :email, :password, :password_confirmation, :remember_me, :avatar, :bio, :title, :company,:facebook,:twitter,:pinterest,:linkedin
  validates_presence_of :username
  validates_uniqueness_of :username, :email, :case_sensitive => false
  has_many :events
  has_many :relationships, foreign_key: "follower_id", dependent: :destroy
  has_many :reverse_relationships, foreign_key: "followed_id",
                               class_name:  "Relationship",
                               dependent:   :destroy
  has_many :followers, through: :reverse_relationships, source: :follower                              
  has_many :followed_users, through: :relationships, source: :followed
  has_many :comments

  has_one :avatar

  def update_without_password(params={})
    params.delete(:current_password)
    super(params)
  end

  def following?(other_user)
    relationships.find_by_followed_id(other_user.id)
  end

  def follow!(other_user)
    relationships.create!(followed_id: other_user.id)
  end

  def unfollow!(other_user)
    relationships.find_by_followed_id(other_user.id).destroy
  end
end
ActiveAdmin.register User do
  form do |f|
    f.inputs "User Details" do
      f.input :email
      f.input :password
      f.input :password_confirmation
      f.input :superadmin, :label => "Super Administrator"
    end
    f.buttons
  end

  create_or_edit = Proc.new {
    @user            = User.find_or_create_by_id(params[:id])
    @user.superadmin = params[:user][:superadmin]
    @user.attributes = params[:user].delete_if do |k, v| 
      (k == "superadmin") ||
      (["password", "password_confirmation"].include?(k) && v.empty? && !@user.new_record?)
    end
    if @user.save
      redirect_to :action => :show, :id => @user.id
    else
      render active_admin_template((@user.new_record? ? 'new' : 'edit') + '.html.erb')
    end
  }
  member_action :create, :method => :post, &create_or_edit
  member_action :update, :method => :put, &create_or_edit
end
# == Schema Information
#
# Table name: users
#
#  id                     :integer          not null, primary key
#  email                  :string(255)
#  encrypted_password     :string(255)
#  reset_password_token   :string(255)
#  reset_password_sent_at :datetime
#  remember_created_at    :datetime
#  sign_in_count          :integer
#  current_sign_in_at     :datetime
#  last_sign_in_at        :datetime
#  current_sign_in_ip     :string(255)
#  last_sign_in_ip        :string(255)
#  created_at             :datetime
#  updated_at             :datetime
#  username               :string(255)
#  bio                    :text
#  title                  :string(255)
#  company                :string(255)
#  facebook               :text
#  twitter                :text
#  pinterest              :text
#  linkedin               :text
#  confirmation_token     :string(255)
#  confirmed_at           :datetime
#  confirmation_sent_at   :datetime
#  unconfirmed_email      :string(255)
#  first_name             :string(255)
#  last_name              :string(255)
#  avatar                 :string(255)
#  avatar_id              :integer
#