Skip to content

Instantly share code, notes, and snippets.

@serek
Forked from toyflish/enviroment.rb
Created April 22, 2010 10:47
Show Gist options
  • Save serek/375070 to your computer and use it in GitHub Desktop.
Save serek/375070 to your computer and use it in GitHub Desktop.
# part of config/enviroment.rb
...
Rails::Initializer.run do |config|
# Load model files from sub folders
config.load_paths += Dir["#{RAILS_ROOT}/app/models/*"].find_all { |f| File.stat(f).directory? }
# Load middleware - initially used by flash-session-hack
config.load_paths << "#{RAILS_ROOT}/app/middleware"
....
# this file should sit at config/initializers/flash_session_middleware.rb
ActionController::Dispatcher.middleware.insert_before(
ActiveRecord::SessionStore,
FlashSessionCookieMiddleware,
ActionController::Base.session_options[:session_key]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment