Class: Haml::Filters::SassRailsTemplate

Inherits:
Sass::Rails::SassTemplate
  • Object
show all
Defined in:
lib/haml/sass_rails_filter.rb

Overview

This is an extension of Sass::Rails’s SassTemplate class that allows Rails’s asset helpers to be used inside Haml Sass filter.

Direct Known Subclasses

ScssRailsTemplate

Instance Method Summary (collapse)

Instance Method Details

- render(scope = Object.new, locals = {}, &block)



6
7
8
9
# File 'lib/haml/sass_rails_filter.rb', line 6

def render(scope=Object.new, locals={}, &block)
  scope = ::Rails.application.assets.context_class.new(::Rails.application.assets, "/", "/")
  super
end

- sass_options(scope)



11
12
13
14
15
# File 'lib/haml/sass_rails_filter.rb', line 11

def sass_options(scope)
  options = super
  options[:custom][:resolver] = ::ActionView::Base.new
  options
end