title: Can't pass a nested object to res.render()?
body: <p>I want to access a variable on client-side javascript, <a href="http://naltatis.github.io/jade-syntax-docs/#variables" rel="nofollow">through jade</a>, passed on <a href="http://expressjs.com/api.html#res.render" rel="nofollow">form the server (node)</a>.</p>
  
  <p>So I make a nested object:</p>
  
  <pre><code>var clientData = 
    {clientData:{
      title: 'Title',
      body: "body",
      appadress: 'localhost' || req.host,
      socketport: socketport,
    } }
  </code></pre>
  
  <p>then pass this object to jade (<a href="http://expressjs.com/api.html#res.render" rel="nofollow">via res.render</a>).. </p>
  
  <pre><code>app.get('/', function(req, res){
    clientData.clientData.appadress = req.host;
    res.render('index.jade', clientData)});
  </code></pre>
  
  <p>which in jade is recieves as.. (i believe)</p>
  
  <pre><code>clientData:{
      title: 'Title',
      body: "body",
      appadress: 'localhost' || req.host,
      socketport: socketport,
    }
  </code></pre>
  
  <p>Then I could pass that on to client-side javascript as a <strong>single</strong> object. </p>
  
  <pre><code>script.
    var clientData = #{clientData}
  </code></pre>
  
  <p>But this isn't working.</p>
  
  <p>Does <code>res.render()</code> not take nested objects like that or something else the problem? </p>