skipping on to 15.11 in which we play with session crap
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
class IndexController < ApplicationController
|
||||
def index
|
||||
session[:first_time] ||= Time.now
|
||||
end
|
||||
|
||||
end
|
2
cookbook/015/hodgepodge/app/helpers/index_helper.rb
Normal file
2
cookbook/015/hodgepodge/app/helpers/index_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module IndexHelper
|
||||
end
|
2
cookbook/015/hodgepodge/app/views/index/index.html.erb
Normal file
2
cookbook/015/hodgepodge/app/views/index/index.html.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
<p>You first visited this site on <%= session[:first_time] %>.</p>
|
||||
<p>That was <%= time_ago_in_words session[:first_time] %> ago.</p>
|
Reference in New Issue
Block a user