Guest User

Untitled

a guest
May 21st, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. class MyController < ActionController::Base
  2. before_filter :restrict_to_development, :only => [:user_report]
  3.  
  4. def index
  5. ...
  6. end
  7.  
  8. def user_report
  9. ...
  10. end
  11.  
  12. protected
  13. # this method should be placed in ApplicationController
  14. def restrict_to_development
  15. head(:bad_request) unless RAILS_ENV == "development"
  16. end
  17. end
  18.  
  19. class MyController < ActionController::Base
  20.  
  21. if RAILS_ENV == "development"
  22. def index
  23. #...
  24. end
  25. end
  26. end
Add Comment
Please, Sign In to add comment