title: How do I render a .builder template in ruby on rails?
body: <p>I am really confused about how to utilize builder templates in ruby on rails.  I have some simple controller code:</p>
  
  <pre><code>class ProductsController &lt; ApplicationController
  
    def index
      @products = Product.all
      respond_to do |format|
        format.html # index.html.erb
        format.xml  # index.builder
      end
    end
  
  end
  </code></pre>
  
  <p>but this does not seem to work.  My index.builder file looks like this:</p>
  
  <pre><code>xm = Builder::XmlMarkup.new(:target=&gt;$stdout, :indent=&gt;2)
  xm.instruct!          
    xm.index{
      @index.each do |i|
        xm.country(i.country.name)
        xm.value(i.value)
        xm.year(i.year)
      end
    }
  </code></pre>
  
  <p>but I keep getting a blank response.  Looks like I am not understanding something fundamental here.</p>