Well, there are many ways to do this. But of course in the long run, none of them will work. A cat is an animal, a wild creature and should not be kept in doors.
Then again, this isn't a perferct world and sometimes cats do have to be kept in doors, in an apartment. So, keeping them happy depends entirely on the cat, As animals- like humans- all have personalities and each one differs from the next.
A very assertive cat will not easily be pleased with a meager scratching post and a few jingly toys, whereas, a more relaxed cat would be content with just that.
Speaking from experience I have come to understand that cats don't like to be alone, if any of you are cat people you will understand this. Though they may not always want a stroke or some fuss, it can pretty much be guaranteed that they'll be close by.
I had 2 cats when I moved to my apartment in june. Hermione- a tunisian calico & Jasmine- a dark silver tabby cat. The calico hermione couldn't stand living her, I woke up every morning half expecting to find a suicide note ["Goodbye cruel world..."]. She literally went mad before my eyes and so after 2 weeks of trying to keep her in, I took her to my girlfriends house, where she now lives [and loves] permanantly.
My other cat- the tabby- Jasmine wasn't that fussed about living here, and though she would look out of the window at the trees she didn't really pine to go out and be with them.
I keep her happy by constantly playing with her when I can. I've changed her foods and rearranged her diet now that she lives in doors and I can really see the difference. She's still just as lively.
There is a page here on the purina website which explains how you should feed an indoor cat
I found it very useful.
To finish, i'd say that to keep a cat happy in an apartment you have to keep them smiling [not literally] and make sure they're happy and that you give them lots of love, talk to them when you can [which I do all the time] and make sure that they know it's not their fault that they're being kept indoors.
[Cat lovers will understand what I mean by this... you can communicate with cats, especially Siamese cats, they're all very intelligent].
I hope this helped.