ruby on rails - Combine strong params with other params -
how can combine strong other params when creating new object.
def params_test params.permit(:test1, :test2, :test3) end = model.new(params_test) a.test4 = 'test4' a.test5 = 'test5'
test4
, test5
coming db or cookies or other source in system. there way combine of them 1 line? or 2 lines?
you do:
model.new(params_test.merge({ test4: 'test4', test5: 'test5'}))
Comments
Post a Comment