Fixed missing database reference.
Converting the mini view to HAML as well.