generate crud for attachment