Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

JavascriptHeader module #99

wants to merge 2 commits into


None yet
2 participants

patriciomacadden commented Apr 5, 2013

I've created a helper module named JavascriptHeader, which behaves like LinkModule, adding the javascript method, which returns script tags for linking javascript files.

Usage (ie in a slim template):

doctype html
  == javascript '/path/to/file.js'
  h1 Hello World

The result will be something like:

<!DOCTYPE html>
    <script src="/path/to/file.js" type="text/javascript"></script>
    <h1>Hello World</h1>

patriciomacadden commented Apr 5, 2013

This PR will fail until #100 gets merged.


zzak commented Aug 11, 2013

I personally don't like this patch for two reasons:

  1. the javascript helper method name is too obscure
  2. it's too similar to javascript_include_tag, is %script{:src=>"foo.js", :type=>"text/javascript"} that hard to type?

What about asset managers? This is encroaching closely to their territory without much benefit.


patriciomacadden commented Aug 11, 2013

Yes, @zzak! You are totally right. Why didn't I closed this earlier? Sorry for the inconveniences!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment