Module: Haml::More::JavaScript::InstanceMethods

Includes:
AbstractHelper
Defined in:
lib/haml/more/javascript.rb

Instance Method Summary collapse

Methods included from AbstractHelper

#haml_helper, included

Instance Method Details

#javascript(*list) ⇒ Object



88
89
90
91
92
93
94
95
96
# File 'lib/haml/more/javascript.rb', line 88

def javascript(*list)
  return javascript(list) if list.size == 2 and list.last.to_s =~ /^\d[\.\d]*$/
  haml_helper do
    list.each do |entry|
      entry = entry.to_a if entry.respond_to? to_a
      haml_tag :script, :type => "text/javascript", :src => self.class.javascript_url_for(*entry)
    end
  end
end