Guest User

Untitled

a guest
Apr 27th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 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.  
  5.  
  6. protect_from_forgery with: :exception
  7. helper_method :current_user
  8.  
  9. def current_user
  10. @current_user ||= User.find(session[:user_id]) if session[:user_id]
  11. end
  12.  
  13.  
  14. def hello
  15. render text: "hello, world!"
  16. end
  17. end
Add Comment
Please, Sign In to add comment