generated posts model and controller