Class: Pannier::Tags::JavaScript
- Inherits:
-
Object
- Object
- Pannier::Tags::JavaScript
- Includes:
- Helpers
- Defined in:
- lib/pannier/mounted/tags.rb
Instance Method Summary collapse
Methods included from Helpers
Instance Method Details
#call(path, attrs) ⇒ Object
38 39 40 41 42 43 44 45 |
# File 'lib/pannier/mounted/tags.rb', line 38 def call(path, attrs) attrs = attrs_to_s({ :type => 'text/javascript', :src => path }.merge(attrs)) template.result(binding) end |
#template ⇒ Object
47 48 49 50 51 |
# File 'lib/pannier/mounted/tags.rb', line 47 def template ERB.new(<<-erb.strip) <script <%= attrs %>></script> erb end |