Section 5.8. Configuring Your Application


5.8. Configuring Your Application

A lot of things can be configured in the config/environment.rb file. This list is not exhaustive:

5.8.1. Session Configuration

 config.action_controller.session_store = :active_record_store # one of :active_record_store, :drb_store, # :mem_cache_store, or :memory_store or your own class ActionController::Base.session_options[:session_key] = 'my_app'     # use an application specific session_key ActionController::Base.session_options[:session_id] = '12345'     # use this session_id. Will be created if not specified ActionController::Base.session_options[:session_expires] = 3.minute.from_now     # how long before a session expires? ActionController::Base.session_options[:new_session] = true     # force the creation of a new session ActionController::Base.session_options[:session_secure] = true     # only use sessions over HTTPS ActionController::Base.session_options[:session_domain] = 'invisible.ch'     # Specify which domain this session is valid for (default: hostname of server) ActionController::Base.session_options[:session_path] = '/my_app'     # the path for which this session applies.  Defaults to the     # directory of the CGI script 

Learn more at the following address: http://api.rubyonrails.com/classes/ActionController/SessionManagement/ClassMethods.html.

5.8.2. Caching Configuration

 ActionController::Base.fragment_cache_store = :file_store, "/path/to/cache/directory" 

Learn more: http://api.rubyonrails.com/classes/ActionController/Caching.html.



Ruby on Rails[c] Up and Running
Ruby on Rails[c] Up and Running
ISBN: B003D3OGCY
EAN: N/A
Year: 2006
Pages: 94

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net