title: How to dynamically display a custom title when using a layout and partials
body: <p>I have a layout and partials that are working fine.  The problem is different models all have the same title.  If would be nice if I can customize the title for each model.</p>
  
  <p>This is my layout:
      </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  
      &lt;title&gt;&lt;%= content_for :title %&gt;&lt;/title&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  
      &lt;%= render 'header' %&gt;
      &lt;%= render "sidebar" %&gt;
      &lt;%= render "content" %&gt;
      &lt;%= render template: "layouts/footer" %&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This is my controller I tried making work based on <a href="https://stackoverflow.com/questions/30116785/undefined-method-content-for-in-presenter-rails">undefined method `content_for&#39; in presenter rails</a>:</p>
  
  <pre><code>class ViewerController &lt; ApplicationController
  
     def index
  
          helpers.content_for :title, "Viewer"
          #helpers.content_for (:title)  "Viewer" #doesn't work
  
     end
  
      def helpers 
  
          ActionController::Base.helpers      
  
      end
  
  end
  </code></pre>
  
  <p>I tried changing the layout to &lt;%= helpers.content_for :title %> but it did not work.  I also tried changing the controller to helpers.content_for (:title)  "Viewer" and elpers.content_for (:title) || "Viewer" based on other posts but they fail.</p>
  
  <p>If this approach does not work then I am open to another.</p>