Set flash messages in create and edit actions only if it's not an Ajax request