title: How do you make an instance variable available to the application.html.erb file in Rails?
body: <p>I have a situation where I want to use an instance variable from a method in all views in a Rails application and I was wondering what is the 'Rails' way to do this.</p>
  
  <p>If I had this situation where I had this code in my <code>subscriptions_controller.rb</code>:</p>
  
  <pre><code>def index
      @subscriptions = current_user.subscriptions
  end
  </code></pre>
  
  <p>What would I do to make this instance variable available to my <code>application.html.erb</code>?  I tried doing this but it doesn't work:</p>
  
  <pre><code>class ApplicationController &lt; ActionController::Base
    protect_from_forgery with: :exception
  
    def index
      @subscriptions = current_user.subscriptions
    end
  end
  </code></pre>
  
  <p>The <code>@subscriptions</code> instance variable is nil, and I'm not too sure why.  What is the best way to do this in Rails? </p>
  
  <p>Thanks!</p>