Set flash messages in create and edit actions only if it's not a XMLHTTPRequest