DRYed up the edit and new view code with a partial.