title: undefined method `url' for nil:NilClass
body: <p>I am new to RoR.</p>
  
  <p>I just download some sample codes and deploy the app.
  After that, I get error message as follows:</p>
  
  <pre><code>undefined method `url' for nil:NilClass
  Extracted source (around line #5):
  
  2: 
  3: &lt;p&gt;
  4:   &lt;b&gt;Url:&lt;/b&gt;
  5:   &lt;%= @page.url %&gt;
  6: &lt;/p&gt;
  7: 
  </code></pre>
  
  <p>And the corresponding codes in pages_controller.rb is</p>
  
  <pre><code>def index 
    @pages = Page.all
    respond_with(@pages)
  end
  </code></pre>
  
  <p>Is there any suggestion for handling this error?
  Thanks</p>