title: Rabl How to render heterogeneous content with partials/extends
body: <p>I have this rabl view that will display either a user or a place, depending of the output of my controller. I tried many things to make it work but I cannot seem to find the right syntax.</p>
  
  <p>Here is my current rabl template (<em>main.rabl</em>) that's returning</p>
  
  <p><em>undefined method `key?' for JSON::Ext::Generator::State:0xcac9520</em></p>
  
  <pre><code>object false
  
  if @user
    child @user do
      extends 'user'
    end
  end
  
  if @place
    child @place do
      extends 'place'
    end
  end
  </code></pre>
  
  <p>And here is the user template (<em>user.rabl</em>):</p>
  
  <pre><code>object @user =&gt; :user
  attributes :id, :email, :firstname, :lastname
  </code></pre>
  
  <p>The extends works pretty well for collections, but it cannot seem to work for this case.</p>
  
  <p>Thanks for your help.</p>