我有類似:如何指定字段爲accepts_nested_attributes_for設置在ActiveRecord的
class Profile < ActiveRecord::Base
belongs_to :user
delegate :full_name, :to => :user
accepts_nested_attributes_for :user
.......
這項工作很好,因爲我想配置文件能夠設置FIRST_NAME和姓氏的用戶。但是,如果用戶在表單中注入其他參數,則會造成安全威脅。
如何使accept_nested_attributes_for只取first_name和last_name並放棄其他參數?