I am diligently going through the Depot example in the AWDWR 2nd Ed. book. I have made it to the end of section 8.4/p109.
My store_controller.rb and store.rhtml files are pretty much exactly as they are in the files that I downloaded from the website.
My problem?: when I access http://localhost:3000/store/wibble, my browser gets redirected properly, but I never see the error text in flash[:notice] because it is empty for some reason.
I do see the expected messages in the log/development.log file:
Attempt to access invalid product whibble flash[:notice] is now Invalid product [I added this; debug code] Redirected to http://localhost:3000/store
I have modified the store.rhtml file to unconditionally print out flash[:notice] but it is always blank. I am even looking at the HTML source to be sure.
I am at a loss to understand why flash[:notice] is blank. I know very little about Ruby or Rails so I’m not quite sure how this should work and I’m not familiar enough with the system to catch this variable getting reset.
Can anybody offer suggestions as to why this variable might be getting reset?
$ ruby -v ruby 1.8.5 (2007-03-13 patchlevel 35) [i386-linux] $ rails -v Rails 1.2.6
I am also using sqlite3, and I have verified that the exception that is getting thrown corresponds to my code.