4. View


#1

Can someone help with this one? I messed up and deleted something and now I get an error that there is an "Undefined method 'each' for niL:NilClass". What do I do?


#2

Here's what it should look like:

<div class="header">
<div class="container">
<img src="http://s3.amazonaws.com/codecademy-content/courses/learn-rails/img/logo-1m.svg">
<h1>Messenger</h1>
</div>
</div>

<div class="messages">

<!-- Your code here -->
<% @messages.each do |message| %> 
<div class="message"> 
<p class="content"><%= message.content %></p> 
<p class="time"><%= message.created_at %></p> 
</div> 
<% end %>
</div>
</div>