I’m a bit stumped. All I’m trying to do is format a date and I get an
error. Details below.
I have a partial to list all “notes” associated with a “client” with the
<% for note in @client.notes %>
<%=h note.note_text %> Posted on <%=h note.created_at.strftime("%I:%M") %> by <%=h note.created_by %> <% end %>
Which gives me the error…
|“You have a nil object when you didn’t expect it! The error occured
while evaluating nil.strftime”
When I remove the |.strftime("%I:%M") from note.created_at the display
works correctly showing the data with the default format of “Fri Feb 17
22:05:10 Central Standard Time 2006 by Sam S.”
I’m still fairly new to Rails so please bear with me.