has_response_extentions.rb 706 B

12345678910111213141516171819202122232425262728293031
  1. module ApplicationController::HasResponseExtentions
  2. extend ActiveSupport::Concern
  3. private
  4. def response_expand?
  5. return true if params[:expand] == true
  6. return true if params[:expand] == 'true'
  7. return true if params[:expand] == 1
  8. return true if params[:expand] == '1'
  9. false
  10. end
  11. def response_full?
  12. return true if params[:full] == true
  13. return true if params[:full] == 'true'
  14. return true if params[:full] == 1
  15. return true if params[:full] == '1'
  16. false
  17. end
  18. def response_all?
  19. return true if params[:all] == true
  20. return true if params[:all] == 'true'
  21. return true if params[:all] == 1
  22. return true if params[:all] == '1'
  23. false
  24. end
  25. end