Hi guys, just a quick one… Running Rails 2.3.2 and following the depot tutorial in the pdf book (P1.0) and I’m seeing this error about an invalid authenticity token when clicking the ‘add to cart’ button after following all the steps in section 8.1. I’ve cleared all the sessions and restarted the server several times with no joy so did some hunting around and can only seem to find the following solution which solves my initial problem but not the bigger picture! Nicholas Arnott posted this a while back on these forums, add the following to the store_controller class
protect_from_forgery :only => [:create, :update, :destroy]
Now while this fixes my ‘add to cart’ action it doesn’t fix my invalid authenticity token issue when adding/updating/deleting existing products, so this leaves me stumped. I can’t find anything anywhere about this issue apart from clearing sessions or a secret key which 2.3.2 has depreciated. Any help is much appreciated.
Kind Regards Richard Delph