Guest User

Untitled

a guest
Apr 19th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. class ApplicationController < ActionController::Base
  2. include ExceptionNotifiable
  3. include AuthenticatedSystem
  4.  
  5. before_filter do |c|
  6. User.current_user = User.find(c.session[:user_id]) unless c.session[:user_id].nil?
  7. end
  8.  
  9. helper :all # include all helpers, all the time
  10. helper_method :current_user, :logged_in?
  11.  
  12. # See ActionController::RequestForgeryProtection for details
  13. # Uncomment the :secret if you're not using the cookie session store
  14. protect_from_forgery :secret => '94d50c8c670e8ae657fd711a57a57ad6'
  15.  
  16. def anonomous_required
  17. !logged_in? || redirect_back_or_default('/')
  18. end
  19. end
Add Comment
Please, Sign In to add comment