Class: Jason::RailsTemplateHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/jason/rails_template_handler.rb

Overview

Rails plugin for using Jason as a template handler.

Name your view templates like so: view_name.jason.

Jason loads this module only if it can find ActionView.

Instance Method Summary collapse

Instance Method Details

#call(template) ⇒ String

Compile the Rails template.

Parameters:

  • template (Class)

    the Rails template class

Returns:

  • (String)

    the compiled template



15
16
17
# File 'lib/jason/rails_template_handler.rb', line 15

def call(template)
  Jason.compile(template.source)
end