I have this in my view which is a multiselect checkbox
Model
class User < ActiveRecord::Base
has_many :user_roles, :dependent =
Answering myself, I got it working not directly, but the below method from the Strong Parameters issues discussion helped me in converting a normal parameter to a whitelisted one.
def user_params
params.require(:user).permit(:first_name).tap do |whitelisted|
whitelisted[:role_ids] = params[:user][:role_ids]
end
end