Thank you Andris, been searching online for nearly 3 hours to figure this out for rails 4 using has_many_through!!
This change int the strong params function works for me, but still requires me to use params[:product][:category_ids] ||= [] in my update controller. Otherwise, submitting the form with all checkboxes unchecked does not work. Are you sure that it works for you without params[:product][:category_ids] ||= [] ?
Thank you Andris, been searching online for nearly 3 hours to figure this out for rails 4 using has_many_through!!
This change int the strong params function works for me, but still requires me to use
params[:product][:category_ids] ||= []
in my update controller. Otherwise, submitting the form with all checkboxes unchecked does not work. Are you sure that it works for you withoutparams[:product][:category_ids] ||= []
?