generate posts controller