title: Rails global variable
body: <p>Im using bootstrap &amp; rails and have a user model and post model..users create posts (collections)..</p>
  
  <p>with bootstrap in the navbar i want the user to be able to click a dropdown which displays the name's of their posts..i did this on one controller with a private method and a before_action but i don't want to do this for all the controllers and it didn't work for the application controller...</p>
  
  <p>is there a better way to do this??</p>
  
  <p>I was doing this</p>
  
  <pre><code>def list
    @user = User.find_by_username(params[:id])
    @collections = @user.collections
  end
  </code></pre>
  
  <p>and a </p>
  
  <pre><code>before_action :list 
  </code></pre>
  
  <p>at the top of the controller</p>
  
  <p>What's the most semantic way to accomplish this??</p>