Toronto. View or Field cameras and Kodak folders, etc used a rail or two rails in parallel to move the lens, lens board (and shutter, if part of the lens) away from or closer to the sensitive media to capture the desired subject in focus.
A ‘box in a box’ design in the 1800s allowed the photographer to pull the boxes apart to focus his scene on the ground glass back. And of course any simple box camera was just a rigid box holding the ‘film’ and lens the correct distance apart for subjects (perhaps at the hyperfocal distance or at infinity depending on the camera design).
Cameras without a rangefinder or a ground glass back, like the folders, etc, usually used a simple scale to measure the distance from camera to subject. The depth of field determined by the aperture setting would compensate for most minor errors in adjustment.
As shown in this snap shot, taken with a Kodak Six-20, the only way in to many hunting camps mid last century was by rail (or by boat). Cars were adapted to run on the rails but one had to be aware of train schedules to avoid a catastrophe!