Module: TemplateTags::ViewHelper

Defined in:
lib/template_tags/view_helper.rb

Instance Method Summary collapse

Instance Method Details

#template_tag(id, options = {}, &block) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/template_tags/view_helper.rb', line 4

def template_tag id, options = {}, &block
  script_tag_options = {type: "text/x-tmpl", id: id}

  if options[:partial].present?
     :script, (render options), script_tag_options
  else
     :script, script_tag_options, &block
  end
end