Adding before_filter to PostsController and refactoring views