Sha256: 05b6cb995df43f80b1169e20f5b551c8e7ba62af0ecdcee9b271fe03538ed201

Contents?: true

Size: 362 Bytes

Versions: 6

Compression:

Stored size: 362 Bytes

Contents

module Opal
  module Rails
    class TemplateHandler
      def self.call(template)
        escaped = template.source.gsub(':', '\:')
        string = '%q:' + escaped + ':;'
        "Opal.parse(#{string})"
      end
    end
  end
end

ActiveSupport.on_load(:action_view) do
  ActionView::Template.register_template_handler :opal, Opal::Rails::TemplateHandler
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
opal-rails-0.2.0 lib/opal/rails/template_handler.rb
opal-rails-0.1.0 lib/opal/rails/template_handler.rb
opal-rails-0.0.5 lib/opal/rails/template_handler.rb
opal-rails-0.0.4 lib/opal/rails/template_handler.rb
opal-rails-0.0.3 lib/opal/rails/template_handler.rb
opal-rails-0.0.2 lib/opal/rails/template_handler.rb