Clint Hill's 33rd-minute header from Matt Phillips' corner put Rangers ahead and Charlie Austin bundled the ball in 11 minutes into the second half - again after a Phillips corner.
But Cardiff hit back, with Sean Morrison heading home before Scott Malone equalised in the final minute with a left-footed strike from near the edge of the penalty area.
Malone scored after Austin had been denied by a goalline clearance from Matt Connolly and both Phillips and Jay Emmanuel-Thomas missed chances for Ramsey's team.
"It's not a good result. We should have taken the points," Ramsey admitted.
"Even before we gave away the two goals we had lots if chances to seal the game and it should have been over well before they scored.
"If Charlie's chance goes in - and the guy's done magnificently to clear it - it would have taken the sting out of them. We also had a one-versus-one just before they scored and Matt Phillips had a one-versus-one as well.
"Cardiff were fantastic in possession and looked dangerous. But we've had balls flashing across the goal and when you haven't taken those chances you get punished in the end.
"We need to work on getting more bodies into the box but even when we did that we didn't take our chances."
Austin, who has been linked with moves to several top-flight clubs, was substituted for the second match running but Ramsey insisted the striker was still feeling the effects of a pre-season injury.
He said: "It was just a precaution. Sometimes you watch players and think, 'He's given his all and it's time to take him off and put someone else on.' Charlie did well today."
Cardiff boss Russell Slade felt Malone's fine strike meant justice was done as Hill appeared to use his arm to nudge ball towards Austin in the build-up to QPR's second goal.
Slade said: "We all went out for a walk this morning and Scott told me he always scores at Loftus Road. I thought, 'Chance would be a fine thing.'
"It was a great finish and gave us something we deserved. They were 2-0 up against the run of play and were fortunate for the second goal. It was definitely handball.
"We were disappointed with the goals we conceded from set plays but between the boxes we had a good structure, good movement and made good choices.
"We just needed a goal - and we got one from a set-play ourselves. I thought our application and attitude were first class."
Slade also praised Simon Moore, whose mistake last weekend led to a goal for Fulham.
The Bluebirds keeper kept his side in the game by making a number of saves before Malone levelled.
"I have to say it was never in my mind to make a change just because he made one mistake in the first half against Fulham," said Slade.
"I think he really rewarded us today and made a couple of really important saves."