Created
June 25, 2009 16:31
-
-
Save edavis10/135962 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class MyController < ApplicationController | |
def index | |
@model = MyModel.new | |
@model.foo = "ABCD" | |
@model.bar = "1234" | |
session[:my_stuff] = @model.session_vars | |
end | |
def show | |
session[:my_stuff][:foo] # "ABCD" | |
session[:my_stuff][:bar] # "1234" | |
end | |
end | |
class MyModel | |
attr_accessor :foo | |
attr_accessor :bar | |
def session_vars | |
{ | |
:foo => @foo, | |
:bar => @bar | |
} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment