It depends on the connections that each device has. In general you would connect the cable box and bluray to the TV with HDMI. The TV will probably have an optical digital audio output that would connect to the sound bar. You would control the volume from the sound bar.
Some sound bars have multiple HDMI inputs and an HDMI output. In this case the cable box and bluray connect to the sound bar with HDMI and the sound bar connects to the TV with HDMI. You then control volume and source from the sound bar.