Module: Racket::Helpers::Sass
- Defined in:
- lib/racket/helpers/sass.rb
Overview
Helper module that allows CSS files to be loaded dynamically using SASS.
Class Method Summary collapse
-
.included(klass) ⇒ nil
Whenever this helper is included in a controller it will setup a link between a SASS directory and a CSS directory.
Instance Method Summary collapse
-
#css(sym) ⇒ String
Get route to CSS, which will use SASS in the background to deliver the CSS.
Class Method Details
.included(klass) ⇒ nil
Whenever this helper is included in a controller it will setup a link between a SASS directory and a CSS directory.
56 57 58 59 60 61 |
# File 'lib/racket/helpers/sass.rb', line 56 def self.included(klass) route = klass.get_route.slice(1..-1) # Remove leading slash sass_dir = add_template_location(klass, route) add_warmup_urls(klass, sass_dir, route) nil end |
Instance Method Details
#css(sym) ⇒ String
Get route to CSS, which will use SASS in the background to deliver the CSS.
28 29 30 31 32 |
# File 'lib/racket/helpers/sass.rb', line 28 def css(sym) route = self.class.get_route route = '' if route == '/' # Special case for root controller "/css#{route}/#{sym}.css" end |