Method: Padrino::Helpers::AssetTagHelpers#javascript_include_tag
- Defined in:
- padrino-helpers/lib/padrino-helpers/asset_tag_helpers.rb
permalink #javascript_include_tag(*sources, options = {}) ⇒ String
Returns a html script tag for each of the sources provided. You can pass in the filename without extension or a symbol and we search it in your appname.public_folder
like app/public/javascript for inclusion. You can provide also a full path.
266 267 268 269 270 271 272 273 |
# File 'padrino-helpers/lib/padrino-helpers/asset_tag_helpers.rb', line 266 def javascript_include_tag(*sources) = { :type => 'text/javascript' }.update(sources.last.is_a?(Hash) ? Utils.symbolize_keys(sources.pop) : {}) sources.flatten.inject(SafeBuffer.new) do |all,source| all << content_tag(:script, nil, { :src => asset_path(:js, source) }.update()) end end |