controller to update posts