title: How to render json with JBuilder in Rails 3.2
body: <p>I'm trying to integrate JBuilder into Rails 3.2 project.  I've installed the gem, and I've written a JBuilder file at <code>app/views/books/index.json.jbuilder</code>.</p>
  
  <p>Here's my index action:</p>
  
  <pre><code>  def index
  
      @books = Book.all
  
      respond_to do |format|
        format.html # index.html.erb
        format.json { render json: @books }
      end
    end
  </code></pre>
  
  <p>This seems to call the default <code>as_json</code> method of <code>Book</code> to render the response. What do I need to change to tell Rails to use my JBuilder template instead?</p>