title: How to display and object relation when some records might not have its value associated yet?
body: <p>I'm starting to learn Rails and I don't know what's the best practices from the language yet.</p>
  <p>I have scaffolded <code>Ticket</code> and <code>Status</code> models (a ticket has its current status). In my database I have records that has no Status associated to (<code>ticket.status</code> is <code>nil</code>), but I also have records that has a Status already associated (<code>ticket.status</code> has <code>#&lt;Status&gt;</code> object).</p>
  <p>When I'm listing all tickets in a table (<code>/tickets</code> url) I'm listing the tickets and displaying the status name (<code>status.nome</code>) like this:</p>
  <pre><code>%td= ticket.status.nome
  </code></pre>
  <p>But I get an error when some records has no status associated: <code>undefined method 'nome' for nil:NilClass</code></p>
  <p>How should I proceed in this case?</p>
  <p>--</p>
  <h1>updated</h1>
  <p><code>Ticket.all</code> gives me:</p>
  <pre><code>#&lt;Ticket id: 5, titulo: &quot;aeeee&quot;, descricao: &quot;desc&quot;, user_id: nil, status_id: nil, created_at: &quot;2015-09-11 07:01:38&quot;, updated_at: &quot;2015-09-11 07:01:38&quot;&gt;
  #&lt;Ticket id: 6, titulo: &quot;teste&quot;, descricao: nil, user_id: nil, status_id: 1, created_at: &quot;2015-09-11 07:09:45&quot;, updated_at: &quot;2015-09-11 07:09:45&quot;&gt;
  </code></pre>