There are already views to render the messages, please take a look, use them once you refactor the HistoryController.