ActiveModel :: ForbiddenAttributesError เมื่อสร้างผู้ใช้ใหม่
ฉันมีโมเดลนี้ใน Ruby แต่มันพ่น a ActiveModel::ForbiddenAttributesError class User < ActiveRecord::Base attr_accessor :password validates :username, :presence => true, :uniqueness => true, :length => {:in => 3..20} VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i validates :email, presence: true, :uniqueness => true, format: { with: VALID_EMAIL_REGEX } validates :password, :confirmation => true validates_length_of :password, :in => 6..20, :on …