created posts controller and view