small medium large xlarge

06 Aug 2009, 17:45
Barry Mccall (4 posts)

After Chapter 8 in the playtime there is this code here ‘session[:counter].’ I know that session is basically a map with key data pairs, but why is ‘:counter’ being passed in as a key? Or even better where does it come from? Previously we used the session like so: session[:id]. ‘:id’ was passed to the add_to_cart function from index.html.erb so I understand that. But how does ‘:counter’ get passed to the index function in the model?


You must be logged in to comment