Note that there are some explanatory texts on larger screens.

plurals
  1. PORails is displaying an empty value and an id in my model view
    primarykey
    data
    text
    <p><img src="https://i.stack.imgur.com/VDW5A.png" alt="List view"></p> <p>I've a rails view that outputs the content of a model value in this case agenda.subject</p> <p>Checking the db the bottom two items are not in the db, I know :id and the blank are but what in my code could cause it to display like this</p> <p>users/index.html.erb</p> <pre><code>&lt;div class="row"&gt; &lt;div class="span8"&gt; &lt;%= render 'agendas/agenda_form' %&gt; &lt;% if @user.agendas.any? %&gt; &lt;h2&gt;Agendas (&lt;%= @user.agendas.count %&gt;)&lt;/h2&gt; &lt;ol class="agendas"&gt; &lt;%= render @agendas %&gt; &lt;/ol&gt; &lt;% end %&gt; &lt;/div&gt; &lt;/div&gt; the _agenda.html.erb partial &lt;li&gt; &lt;span class="content"&gt;&lt;%= agenda.subject %&gt;&lt;/span&gt; &lt;%= link_to 'delete', agenda, method: :delete, confirm: "You Sure?", title: agenda.subject %&gt; &lt;/li&gt; </code></pre> <p>and the users controller</p> <pre><code>class UsersController &lt; ApplicationController before_filter :authenticate_user! def index @user = current_user @agenda = current_user.agendas.build if signed_in? @agendas = current_user.agendas end end </code></pre> <p>.... user_id: 1, created_at: "2012-05-17 15:52:22", updated_at: "2012-05-17 15:52:22">, #] 8</p> <p>[<code>#&lt;Agenda id: 49, subject: "Ut qui vel eos quia vitae.", due_date: nil, completed: nil, user_id: 1, created_at: "2012-05-17 15:52:22", updated_at: "2012-05-17 15:52:22"&gt;, #&lt;Agenda id: 43, subject: "Enim dolorem.", due_date: nil, completed: nil, user_id: 1, created_at: "2012-05-17 15:52:22", updated_at: "2012-05-17 15:52:22"&gt;, #&lt;Agenda id: 37, subject: "Rerum architecto est nihil totam.", due_date: nil, completed: nil, user_id: 1, created_at: "2012-05-17 15:52:22", updated_at: "2012-05-17 15:52:22"&gt;, #&lt;Agenda id: 31, subject: "Non.", due_date: nil, completed: nil, user_id: 1, created_at: "2012-05-17 15:52:22", updated_at: "2012-05-17 15:52:22"&gt;, #&lt;Agenda id: 25, subject: "Libero enim et explicabo.", due_date: nil, completed: nil, user_id: 1, created_at: "2012-05-17 15:52:22", updated_at: "2012-05-17 15:52:22"&gt;, #&lt;Agenda id: 19, subject: "Et molestiae et quia saepe quia.", due_date: nil, completed: nil, user_id: 1, created_at: "2012-05-17 15:52:22", updated_at: "2012-05-17 15:52:22"&gt;, #&lt;Agenda id: 7, subject: "Eum consectetur iste.", due_date: nil, completed: nil, user_id: 1, created_at: "2012-05-17 15:52:22", updated_at: "2012-05-17 15:52:22"&gt;, #&lt;Agenda id: nil, subject: nil, due_date: nil, completed: nil, user_id: 1, created_at: nil, updated_at: nil&gt;] 8</code></p> <p>I excluded the first couple of records they looked normal but its those last 2 that are weird Output from @agendas.inspect and @agendas.length</p> <p>I am using faker to create a sample data fro the app, possibly culprit?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload