Checking in the controller instead of the view

Changing class 'error' with 'warning'