title: Rails how to change attribute name when rendering json?
body: <p>In my controller  I have:</p>
  
  <pre><code>@pakkes = Pakke.where("navn like ?", "%#{params[:q]}%")
  
  respond_to do |format|
    format.html # index.html.erb
    format.xml  { render :xml =&gt; @pakkes }
    format.json { render :json =&gt; @pakkes.map(&amp;:attributes) }
  end
  </code></pre>
  
  <p>How do I change the attribute <code>navn</code> to <code>name</code> when rendering JSON? </p>