Guest User

Untitled

a guest
Jul 22nd, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. class ApplicationController < ActionController::Base
  2.  
  3. def authenticate
  4. authenticate_or_request_with_http_basic do |user, password|
  5. user == USER_ID && password == PASSWORD
  6. end
  7. end
  8.  
  9. end
  10.  
  11.  
  12. class ApiController < ApplicationController
  13.  
  14. before_filter :authenticate
  15.  
  16. def index
  17. ...
  18. end
  19.  
  20. end
Add Comment
Please, Sign In to add comment