custom_css_controller.rb 429 B

123456789101112131415161718192021
  1. # frozen_string_literal: true
  2. class CustomCssController < ActionController::Base # rubocop:disable Rails/ApplicationController
  3. before_action :set_user_roles
  4. def show
  5. expires_in 3.minutes, public: true
  6. render content_type: 'text/css'
  7. end
  8. private
  9. def custom_css_styles
  10. Setting.custom_css
  11. end
  12. helper_method :custom_css_styles
  13. def set_user_roles
  14. @user_roles = UserRole.providing_styles
  15. end
  16. end