Module: Haml::Filters::Javascript
- Includes:
- Base
- Defined in:
- lib/jsdefer-haml.rb
Instance Method Summary collapse
Instance Method Details
#render_with_options(text, options) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/jsdefer-haml.rb', line 9 def (text, ) if [:format] == :html5 type = '' else type = " type=#{[:attr_wrapper]}text/javascript#{[:attr_wrapper]}" end JsDefer.instance.push_script "<script#{type}> //<![CDATA[ #{text.rstrip.gsub("\n", "\n ")} //]]> </script>" nil end |