Class List Method List File List

# Class: Haml::Filters::SassRailsTemplate

Inherits:
  Sass::Rails::SassTemplate
  - Object
  - Sass::Rails::SassTemplate
  - Haml::Filters::SassRailsTemplate
  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)

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

## 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