diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-26 13:35:22 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-26 13:35:22 +0000 |
commit | cef57e0cc244062663ad5fc5652072a12f06aaf2 (patch) | |
tree | d3225f6721c4e0cd783e38eaf04537b203ab19c5 | |
parent | a5b55c6b9f8e09bb0936b30f5c096b28bafe00a4 (diff) | |
download | rails-cef57e0cc244062663ad5fc5652072a12f06aaf2.tar.gz rails-cef57e0cc244062663ad5fc5652072a12f06aaf2.tar.bz2 rails-cef57e0cc244062663ad5fc5652072a12f06aaf2.zip |
Added documentation on models in sessions #929 [c.r.mcgrath@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1000 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rwxr-xr-x | actionpack/lib/action_controller/base.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index 8db1a476bf..a0c1bb2e2e 100755 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -105,6 +105,13 @@ module ActionController #:nodoc: # Any object can be placed in the session (as long as it can be Marshalled). But remember that 1000 active sessions each storing a # 50kb object could lead to a 50MB memory overhead. In other words, think carefully about size and caching before resorting to the use # of the session. + # + # If you store a model in the session, you must also include a line like: + # + # model :person + # + # For that particular controller. In Rails, you can also just add it in your app/controller/application.rb file (so the model is available + # for all controllers). This lets Action Pack know to have the model definition loaded before retrieving the object from the session. # # For removing objects from the session, you can either assign a single key to nil, like <tt>@session[:person] = nil</tt>, or you can # remove the entire session with reset_session. |