Generate posts controller