A device for controlling fluid media, such as a directional control valve, includes a molded part made from an elastomeric material in which at least one line section is formed. The line section connects at least two connections to one another, between which at least one flow path extends. The device or valve has a control unit that includes an actuator coupled to at least one blocking element. The at least one blocking element is displaced by the actuator between a blocking position and a release position. In the blocking position, the at least one blocking element deforms the at least one line section in order to block the at least one flow path.