title: Rails: how to exclude post requests for a before_action in the application controller
body: <p>I have a rails app. I use a before_action in my application controller to get a variable for all identified users (I use it in the header so I need it for all my views).</p>
  
  <p>However, it slows down all my post requests which do not need the variable. I tried to find a way googling it but couldn't find anything. Also, I'm not sure what I am doing is a best practice for the application controller... </p>
  
  <p>How could I exclude all the post requests for this before_action?</p>
  
  <p>One solution would be to copy/paste the code in all my controllers but it seems not the best...</p>
  
  <p>Thanks.</p>