modify app/controllers/posts_controller.rb. 'before_action'