Skip to content

Commit

Permalink
sesh
Browse files Browse the repository at this point in the history
  • Loading branch information
mischa committed Apr 3, 2010
1 parent 35ea7ad commit 955ae98
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
18 changes: 14 additions & 4 deletions app/controllers/application_controller.rb
@@ -1,10 +1,20 @@
# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.

class ApplicationController < ActionController::Base
helper :all # include all helpers, all the time
protect_from_forgery # See ActionController::RequestForgeryProtection for details

# Scrub sensitive parameters from your log
# filter_parameter_logging :password
filter_parameter_logging :password, :password_confirmation
helper_method :current_user_session, :current_user

private
def current_user_session
return @current_user_session if defined?(@current_user_session)
@current_user_session = UserSession.find
end

def current_user
return @current_user if defined?(@current_user)
@current_user = current_user_session && current_user_session.user
end

end
3 changes: 2 additions & 1 deletion config/environment.rb
Expand Up @@ -20,6 +20,7 @@
# config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
# config.gem "sqlite3-ruby", :lib => "sqlite3"
# config.gem "aws-s3", :lib => "aws/s3"
config.gem 'authlogic'

# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named
Expand All @@ -39,4 +40,4 @@
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
# config.i18n.default_locale = :de
end
end
3 changes: 3 additions & 0 deletions config/routes.rb
Expand Up @@ -19,6 +19,9 @@
map.resources :grants

map.resource :dictionary

map.resource :user_session


# Sample resource route with options:
# map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
Expand Down

0 comments on commit 955ae98

Please sign in to comment.