forked from m-Peter/activeform
-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
I have form:
class Forms::Publishers::CreateForm < ActiveForm::Base
attributes :name
validates :name, presence: true
endThen 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(...)orstrong_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