I am using devise gem for user session operations. I want to import data to the user model in the admin panel.
Ruby version: 2.4.1p111
Rails version: Rails 5.1.4
Admin panel gem: activeadmin
Admin panel import gem: active_admin_import
admin/user.rb
ActiveAdmin.register User do
active_admin_import validate: true,
template_object: ActiveAdminImport::Model.new(
hint: "Dosyanızda veriler belirtilen başlıklar altında olmalıdır: 'email', 'identity_no', 'password', 'password_confirmation'",
csv_headers: ['email', 'identity_no', 'password', 'password_confirmation']
)
permit_params :email, :identity_no, :password, :password_confirmation
....
...
end
models/user.rb
class User < ApplicationRecord
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
has_one :profile, dependent: :destroy
has_many :graduations, dependent: :destroy
has_many :works, dependent: :destroy
validates :identity_no, presence: true
...
...
end
I received the error message:
can't write unknown attribute password
How can I resolve this error?