refactored with partial in new and edit post forms, improved error reporting