title: ruby on rails global method
body: <p>I have a user controller which consists of a method named listfolders().</p>
  
  <pre><code>class UserController &lt; ApplicationController
  
   def myaccount()
  
      userId = session[:id]
  
      @listfolders = UsersFolders.listfolders(userId)
  
      @users = User.listusers()
  
  
    end
  end
  </code></pre>
  
  <p>In the views I have and I'm able to fetch the folders:</p>
  
  <pre><code>&lt;% @listfolders.each do |userfolder| %&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;a href="#" target="cstr"&gt;&lt;b&gt;&lt;%= userfolder.foldername %&gt;&lt;/b&gt;&lt;/a&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>PROBLEM: I want to display the folders in all pages like compose,drafs,trash etc ... instead of just for the action.</p>
  
  <p>How can I do it ?</p>