Sha256: 9088f9cef1b7e4c4015c0960b40a4582c2cd67bd28c74b7b1f98120401a2e3b0
Contents?: true
Size: 532 Bytes
Versions: 56
Compression:
Stored size: 532 Bytes
Contents
# Example usage: # # Add: # gem 'ruby2js' # to your gemfile and bundle # Add: # require "ruby2js/haml" # to any initializer ot config/application.rb # # Use :ruby2js filter in your templates like # # :ruby2js # alert "Hello" # # (Note missing brackets: ruby syntax, js sematics) # require "haml" module Ruby2JS module Haml::Ruby2JS include Haml::Filters::Base def render(text) converted = Ruby2JS.convert(text).to_s "<script type='text/javascript'>\n#{converted}\n</script>" end end end
Version data entries
56 entries across 56 versions & 1 rubygems