title: Sails.js: How To Access Data in Server-Side EJS View for Single Model
body: <p>The Sails.js Wiki clearly describes how to loop through an array of models and generate HTML. See <a href="https://github.com/balderdashy/sails/wiki/views" rel="nofollow">https://github.com/balderdashy/sails/wiki/views</a>. However it is not clear to me how to get at the model for a <strong>details</strong> view.</p>
  
  <p>Given a model generated via the shell command: <code>sails generate user</code>, there will be these routes:</p>
  
  <pre><code>/user
  /user/:id
  </code></pre>
  
  <p>(Here <code>:id</code> is a token replaced with the unique id of the model. For more details see <a href="http://sailsjs.org/#documentation/routes" rel="nofollow">http://sailsjs.org/#documentation/routes</a>.)</p>
  
  <p>The wiki's example handles the first route, <code>/user</code>, but what happens when you go to <code>/user/:id</code>--how do you get at the model from the EJS view?</p>
  
  <p>I would expect something like <code>&lt;%= model.propertyName %&gt;</code> would work.</p>
  
  <p>Bare in mind I'm asking about generating the HTML <strong>on the server</strong>. (I know how to get the data and render client-side.)</p>