Shelter Dog...

I bought a dog from a shelter yesterday and as expected she will probably be a little bad until we get her used to everything. She is a Border Collie, and after we gave her a bathing after drying her off, she went to the bedroom and ripped up our carpet. Which is really bad on our side because we live in a townhouse/condo. My husband has gotten after her repeatedly for doing things like she peed on the carpet I guess some time in the night and she did it again right after I took her outside... what I'm asking is does anyone that's homed a shelter dog or have a Border Collie know how to train her?. We've thought about dog classes for her but they're kind of expensive. She's a really sweet dog, she's just terrified of the cat and really hates baths.