Handle strong params in enterprise_roles controller

This commit is contained in:
Luis Ramos
2020-02-23 17:49:35 +00:00
parent 6ba3a3c373
commit 34488e5f63

View File

@@ -7,7 +7,7 @@ module Admin
end
def create
@enterprise_role = EnterpriseRole.new params[:enterprise_role]
@enterprise_role = EnterpriseRole.new enterprise_role_params
if @enterprise_role.save
render text: Api::Admin::EnterpriseRoleSerializer.new(@enterprise_role).to_json
@@ -22,5 +22,11 @@ module Admin
@enterprise_role.destroy
render nothing: true
end
private
def enterprise_role_params
params.require(:enterprise_role).permit(:user_id, :enterprise_id)
end
end
end