Added database functionality and ERB template for lists pages