Open
Description
I have form:
class Forms::Publishers::CreateForm < ActiveForm::Base
attributes :name
validates :name, presence: true
end
Then in a controller I submit params:
form = Forms::Publishers::CreateForm.new(publisher)
form.submit(params)
But if params contain not name
key (example: foo
) I have error: NoMethodError: undefined method
foo=' for #Forms::Publishers::CreateForm:0x007f85805f70a0. It force my to use
params.slice(...)or
strong_parameters` gem. Why not just ignore attributes which don't defined? I thought form should receive any params but assign only defined?
Metadata
Metadata
Assignees
Labels
No labels