added code in index method for User controller and index.json.jbuilder for view/user to link up the posts to users