Method: Docks::Helpers::Path#javascript_include_tag
- Defined in:
- lib/docks/helpers/path_helper.rb
#javascript_include_tag(script) ⇒ Object
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/docks/helpers/path_helper.rb', line 48 def javascript_include_tag(script) pathname = Pathname.new(script) path = if pathname.absolute? pathname.to_path else relative_asset_path(File.join(Docks.config.asset_folders.scripts, "#{pathname.extname.length > 0 ? script.sub(/#{pathname.extname}$/, "") : script}.js")) end "<script src='#{path}'></script>" end |