Module: BackboneHandlebars::RenderTemplatesHelper

Defined in:
lib/backbone-handlebars/helper.rb

Instance Method Summary collapse

Instance Method Details

#render_backbone_template(template) ⇒ Object



3
4
5
# File 'lib/backbone-handlebars/helper.rb', line 3

def render_backbone_template(template)
  raw File.read(::Rails.root.join "app", "assets", "templates", "#{template}.handlebars.html")
end

#render_backbone_templatesObject



7
8
9
10
11
# File 'lib/backbone-handlebars/helper.rb', line 7

def render_backbone_templates
  template_directory = ::Rails.root.join "app", "assets", "templates", "*.handlebars.html"
  templates = Dir.glob(template_directory).collect { |t| File.read t }
  raw templates.join("\n")
end