Ruby on Rails:Remove some elements in Strong parameters -
examples: have 4 check boxes boolean values correspond 4 texts : a,b,c,d.
i need push texts checked ( = true ).
but in default,strong parameters values our form save database, need push 1 of them , not all. need remove text isn't checked in strong parameters . how can ??
know after strong parameters permitted , can not change inside it.
strong parameters in controller:
params.require(:question).permit(:id, :job_id, :content,answers_attributes: [ :id, :content,:result ])
(answers nested atribute)
Comments
Post a Comment