I have an addition member variable (no DB column) that I would like on
my model called postcode.
To make it available to the view when creating a new record I have added
@postcode = “”
But now all the other members on my model (the ones that should be there
after Model.new) are gone, and the view reports a nil error…
You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.include?
Extracted source (around line #110):
110: <%= text_field ‘entity’, ‘name’ %>
If I remove the initialize method they reapear, but then, of course,
postcode is nill and the rendering fails with the same error.