Guest User

Untitled

a guest
Apr 26th, 2016
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. class ApplicationController < ActionController::Base
  2. # Prevent CSRF attacks by raising an exception.
  3. # For APIs, you may want to use :null_session instead.
  4. protect_from_forgery with: :exception
  5.  
  6.  
  7. private
  8.  
  9. def current_user
  10. @current_user ||= User.find(session[:user_id]) if session[:user_id]
  11. end
  12.  
  13. helper_method :current_user
  14.  
  15.  
  16. def hello
  17. render text: "hello, world!"
  18. end
  19. end
Add Comment
Please, Sign In to add comment