Refactoring: refactor method set_alert in ApplicationController class.