I was working on chapter 9 from the Agile Web Development with Rails. I noticed that clicking on the “Add to Cart” button did not work. I checked my code a few times and found that the code was fine.
I could not find anything useful using the Google search.
I remembered a quote from one of the Sherlock Holmes adventures, “When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.”
I started going through the potential issues that I could think of:
1. I thought I incorrectly typed the code. I even tried to copy and to paste the code from the book. Problem was still there…
2. I checked the logs and thought that the database was not working. I saw the database query worked correctly. I even restarted the MySQL server.
3. I tried using Safari to access the project (I usually use Firefox). I wanted to make sure that I could reproduce the problem with a different browser. The problem was there. “Interesting” was the word that came to mind.
4. I restarted Mongrel and the problem persisted. Hmmm… OK.
5. I restarted my Mac. Silly me…
6. Finally, I thought that I might have used an older version of Rails since I created the depot project and Rails defaulted the version to 1.1.6.
(more…)