Closed sinansh closed 7 years ago
I am using devise gem for user session operations. I want to import data to the user model in the admin panel.
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
can't write unknown attribute password
Ruby version: 2.4.1p111 Rails version: Rails 5.1.4
How can I resolve this error?
@sinansahin duplicate of #16 ?
I am using devise gem for user session operations. I want to import data to the user model in the admin panel.
admin/user.rb
models/user.rb
I received the error message:
can't write unknown attribute password
Ruby version: 2.4.1p111 Rails version: Rails 5.1.4
How can I resolve this error?