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

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
2 participants
Member

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
head
  == javascript '/path/to/file.js'
body
  h1 Hello World

The result will be something like:

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

patriciomacadden commented Apr 5, 2013

This PR will fail until #100 gets merged.

Owner

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.

Member

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