Module: Coffee::Filter::Coffeescript

Includes:
Haml::Filters::Base
Defined in:
lib/coffee-filter/coffeescript.rb

Instance Method Summary collapse

Instance Method Details

#render_with_options(text, options) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/coffee-filter/coffeescript.rb', line 10

def render_with_options(text, options)
  <<END
<script type=#{options[:attr_wrapper]}text/javascript#{options[:attr_wrapper]}>
  //<![CDATA[
    #{CoffeeScript.compile(text)}
  //]]>
</script>
END
end