Hi!
I used scaffold to create my mvc for my table. I have only written
one other ROR application, and since I was winging it, I didn’t take
advantage of the rails-generate code.
My scenario is:
User clicks save on form, and is redirected to the “show” view where
they see what they just saved. Code is this:
<% session[:ward_id] = @ward %>
<% for column in Ward.content_columns %>
<%= column.human_name %>:
<% if column.null == "true" %>
<% else %>
<%=h @ward.send(column.name) %>
<% end %>
<% end %>My error is that beloved “you have a nil object when you didn’t expect
it!”
I am trying to check for nil values and have it just display nothing
but the human_name when it hits a nil. I have tried many different
combinations and can’t seem to get it right. Any direction or
suggestion is always appreciated!!
Thank you!!
~~Ali