Zend certified PHP/Magento developer

I need to show configurable products that are out of stock and block their purchase

I need to show configurable products that are out of stock and block their purchase.
To show out of stock. For normal products it works fine, but in the case of configurable products it just doesn’t show them.
I managed to show all products. But the buy button is also available for products that are out of stock