I have a model Secret with 3 fields: f1, f2 and f3.
I have a form where user can input only f1 and f2. Not f3.
What is the best way to pass values to new object?
If I will write @secret = Secret.new(params[:secret]), evil user may pass f3 to my model, and it will be saved in model.
What is the best way to prevent users from passing extra values?
I read http://guides.rubyonrails.org/security.html#mass-assignment and there are 3 variants:
1) Blacklist (attr_protected :f3)
2) Whitelist (attr_accessible :f1, :f2)
3) Global whitelist (force attr_accessible by configuration line config.active_record.whitelist_attributes = true)
What method is the best?