Use a before_action to set up the Post object for the necessary actions, so that you don't have to set the @post ivar for each of those actions. See the scaffolded code for example.