Chopra's eighth league goal of the season and Ramsey's first goal since his arrival on loan from Arsenal saw the Bluebirds return to winning ways following Saturday's Championship defeat to fellow promotion candidates Nottingham Forest.
After a quiet 15 minutes at the Cardiff City Stadium, the game came to life with Aiyegbeni Yakubu having the first chance, but the Nigerian's shot was well saved by Tom Heaton following good link-up play with Paul Gallagher.
Leicester had another chance soon after when Lloyd Dyer found Patrick van Aanholt on the left, but the on-loan Chelsea defender's shot was well blocked by Heaton.
Cardiff opened the scoring against the run of play on 21 minutes when Seyi Olofinjana found Chopra and the striker made no mistake, sweeping the ball into the bottom corner from 12 yards.
The Foxes continued to attack in search of an equaliser with Jeffrey Bruma going close, but the defender could not keep his 20-yard shot underneath the crossbar.
On-loan Everton striker Yakubu tried his luck from distance five minutes before half-time, but despite troubling Heaton, the ball fizzed just wide of the left upright.
Leicester started the second half much like they ended the first with Ritchie Wellens testing Heaton from 20 yards, with the goalkeeper having to tip the midfielder's shot around the post.
The Bluebirds weathered the storm once again and doubled their advantage on 51 minutes when midfielder Ramsey coolly slotted Kevin McNaughton's cross into the bottom corner from 12 yards.
The home side went close to putting the game out of the Foxes' reach with Jay Emmanuel-Thomas testing Ricardo with a header from a Peter Whittingham free-kick, while Jay Bothroyd had a shot blocked by Ben Mee.
Cardiff boss Dave Jones introduced Jon Parkin on 75 minutes to freshen up his strikeforce and the striker took less than two minutes to test Ricardo with an 18-yard shot.
Substitute Chris Burke easily skipped past two defenders but after creating an opening, shot wide of the target while Van Aanholt had another shot saved by Heaton.
Cardiff closed out the game smartly, keeping hold of the ball to ensure they picked up a vital three points in their quest for promotion to the Premier League.