A hub assembly for a wheelchair has a hub device and a switch device. The hub device has a hub shell, an axle, a ring and a ratchet. The ratchet has a cylinder section. The cylinder section has a recess formed in an outer surface of the cylinder section. The switch device has a pin and a wire. The pin is capable of being selectively inserted into the recess. The wire is securely connected with the pin. Because the pin is inserted into the recess and the ratchet engages the ring, the hub shell along with a wheel cannot be moved unintentionally backward on a ramp.