Ah... i think i see what it is. When you turn the work over, you have to remember you're doing the opposite. The stitches you knit on the one side, you have to purl on the opposite side. And vice-versa. Do you have an even number of ribs, so you start each row with a knit rib and end with a purl rib?
If you have an odd number of ribs, you must start and finish with knit ribs on one side, and start and finish with perl ribs on the other side. Amy has a video about ribbing, which tells you how to recognize what kind of stitch was done on the previous row.
Okay, I should mention that I am knitting the hat in the round. You still knit the knits and purl the purls, but the stitches in the round are always on the front side.
When ribbing flat you still knit the knits and purl the purls. You either have to remember what the last set was OR learn what purl and knit stitches look like. I vote for learning what stitches look like. It has helped me tremendously!
I have an even number of ribs on my hat in the round. since i have 100 co stitches I guess it would be 50.
When asking questions ALWAYS post the name and a link for the pattern if you have it.