Module: Haml::Filters::DeferJS

Includes:
Base
Defined in:
lib/rbbt/rest/common/misc.rb

Instance Method Summary collapse

Instance Method Details

#render(text) ⇒ Object



266
267
268
269
270
271
272
273
274
275
276
277
# File 'lib/rbbt/rest/common/misc.rb', line 266

def render(text)
  step_path = Thread.current["step_path"]
  defer_text ="%script\n:plain\n  defer(function(step_path){\n\n\#{text.gsub(/^/,\"      \")}\n  }, '\#{step_path}')\n"
  Haml::Engine.new(defer_text).to_html 
end