added methods to PostsController to allow viewing and storing posts to a MySQL database