title: Pass parameters from as_json to model
body: <p>Controller:</p>
  
  <pre><code>user = User.find(params[:id])
  respond_with({:posts =&gt; @posts.as_json})
  </code></pre>
  
  <p>Model:</p>
  
  <pre><code>def as_json(options = {})
    {
      name: self.name,
      ...
    }
  end
  </code></pre>
  
  <p>I want to pass parmeters like <code>params[:id]</code> to the <code>as_json</code> function to change things in the JSON display.</p>
  
  <p>How can I do it?</p>