title: Ruby on Rails: provide vs content_for
body: <p>I came across the view helper function "provide" today. By looking into its manual I am still confused on how it is different from "content_for".</p>
  
  <blockquote>
    <p>provide(name, content = nil, &amp;block)</p>
    
    <p>The same as content_for but when used with streaming flushes straight
    back to the layout. In other words, if you want to concatenate several
    times to the same buffer when rendering a given template, you should
    use content_for, if not, use provide to tell the layout to stop
    looking for more contents.</p>
  </blockquote>
  
  <p>Question 1: this is quite abstract to me - could anyone flesh it out by giving a demonstrative example?</p>
  
  <p>Question 2: working with asset pipeline, which performs better and why?</p>
  
  <p>Thanks!</p>