Best practice for adding Resistor to PLC cabinet
A search for "DIN rail component carrier" throws up images such as this.



Figure 1. A user-configurable PCB with screw terminals and DIN rail mount. Image source: Google image search.

For just one or two resistors or diodes it's common to connect them using standard DIN terminals.