small medium large xlarge

3_ana_-_______100x100_pragsmall
21 Oct 2010, 17:12
DesireToWin (1 post)

ActionController::InvalidAuthenticityToken in StoreController#add_to_cart Parameters: {“authenticity_token”=>”v/81mUcwlGYWkZegKVRb/ElhHzcDc4HQWNh3xD8UcRs=”, “id”=>”1”}

I got this error on Cart Creation chapter while I click ‘Add to cart’ button. I read this forum and same topic, but solutions is not working for me…

my source files:


session_store.rb: ActionController::Base.session = { :key => ‘_depot_session’, :secret => ‘7613b8c1c61f2ff3a1b5e22736e84c8b4fbd579c907e45ff94599f676492ec6e62d7be501850869d999f2705db0e99699e35b40a694e6d453bad7f658b5b83f1’ } ActionController::Base.session_store = :active_record_store # uncommented!
————————–

application_controller.rb: class ApplicationController < ActionController::Base helper :all # include all helpers, all the time protect_from_forgery # See ActionController::RequestForgeryProtection for details

# Scrub sensitive parameters from your log # filter_parameter_logging :password

end

store_controller.rb, cart.rb, cart_item.rb, add_to_cart.html.erb, index.html.erb i downloaded from http://media.pragprog.com/titles/rails3/code/depot_f/app/

I tried add the line protect_from_forgery :only => [:create, :update, :destroy] in my store_controller.rb, as result, while adding two items in a cart displays only one (last) item.

Help, please

You must be logged in to comment