D
Danny L.
hey guys the following line of code is producing a "undefined method
`+':
@plays += 1
cheers,
Danny
`+':
@plays += 1
cheers,
Danny
Is it an "undefined method '+' on NilClass"? If so, you forgot to
assign a value to @plays before incrementing it. You might try
something like this instead:
def plays
@plays ||= 0
end
def plays=(v)
@plays = self.plays + 1
end
~ jf
--
John Feminella
Principal Consultant, BitsBuilder
LI: http://www.linkedin.com/in/johnxf
SO: http://stackoverflow.com/users/75170/
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.