handle the index and show routes of posts