Rotary encoder mounting on gpio connectors

this is how I have wired mine and is working: