How can i whitelist params when used with constantize?

x = “SomeClass”.classify.constantize.new(params)

On Monday, April 20, 2015 at 4:05:07 PM UTC+1, der_tom wrote:

x = “SomeClass”.classify.constantize.new(params)>> how can i get the params
whitelisted? thank you!

This shouldn’t make any difference to how you whitelist the params -
what problems are you having?

Fred

hi
the problem is my update method:
@rec.update(params[:rec].require(@form.sourcetable.singularize.parameterize.underscore.to_sym).permit!)

->
param not found: employer (@rec is the record to be updated)

and here is the params hash:

{“utf8”=>“✓”,
“_method”=>“patch”,
“authenticity_token”=>“GNgGZsqKQgZOcKvGV2pn/sdQ+C/EAqTmQO/bt93cGmo=”,
“rec”=>{“id”=>“3”,
“name”=>“3334”,
“company_id”=>"",
“created_at”=>“2015-04-21 13:48:17 UTC”,
“updated_at”=>“2015-04-21 13:48:17 UTC”,
“no”=>"",
“address”=>"",
“address_2”=>"", …

On Tue, Apr 21, 2015 at 1:59 AM, Frederick C. <