Add configurable products to cart from categiry page

Is there any way that we can add configurable product to cart from category page with their attributes, like color, size etc ? Right now when i add any configurable product to cart it redirects me on product page.