World in Motion client Danny Ward has signed for Cardiff City from Rotherham United.