← Back to Upcase

Undefined method `id' for nil:NilClass


(Tony Brown) #1

undefined method `id’ for nil:NilClass

if cookies[:mentor_id].blank?
      cookies[:mentor_id] ||= @mentor.id
    end
  end
end

Here is a trace: in a gist


(Derek Prior) #2

cookies[:mentor_id] is not not set, nor is @mentor. You’re trying to cal id on nil, just as the error says.


(Tony Brown) #3

Thanks @derekprior I’m working my way through the code