Created
April 12, 2012 17:18
-
-
Save markahesketh/2369279 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /app/controllers/store_controller.rb | |
class StoreController < ApplicationController | |
def index | |
@products = Product.all | |
session[:counter] ||= 0 | |
@count = session[:counter] += 1 | |
end | |
end | |
# /app/views/store/index.html.erb | |
... | |
<h2>The count <%= count %></h2> | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment