Class: StylesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- StylesController
- Defined in:
- app/controllers/styles_controller.rb
Overview
Foodcoop-specific styling
Instance Method Summary collapse
-
#foodcoop ⇒ Object
renders foodcoop css, or 404 if not configured.
Methods inherited from ApplicationController
Methods included from PathHelper
#finance_group_transactions_path
Instance Method Details
#foodcoop ⇒ Object
renders foodcoop css, or 404 if not configured
When requested with the parameter md5
, the result is returned with an expiry time of a week, to leverage caching.
9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/styles_controller.rb', line 9 def foodcoop css = FoodsoftConfig[:custom_css] if css.blank? render body: nil, content_type: 'text/css', status: :not_found else expires_in 1.week, public: true if params[:md5].present? render body: css, content_type: 'text/css' end end |