title: how to use rails format.json
body: <pre><code>def index
  @cellphones = Cellphone.all
  
  respond_to do |format|
    format.html # index.html.erb
    format.json { render json: @cellphones }
  end
  </code></pre>
  
  <ul>
  <li><p>SIMPLE ANSWERS PLEASE...</p>
  
  <ul>
  <li><p>what is <b>format.json</b> used for?</p></li>
  <li><p>do I have to create a view for it?</p></li>
  <li><p>how does it relate to <b>javascrip</b>?</p></li>
  <li><p>how does it relate to to <b>ajax</b>?</p></li>
  <li><p>please give a simple example of how to use it...</p></li>
  </ul></li>
  </ul>