clean up code, remove so not too many copy paste

cleaned up code for the render whether it is 'add' or 'edit' in
FoodPage.