I'm trying to add jquery to a Phoenix project.
When I link to jquery direct in app.html.eex in the head tag like so:
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
...It works.
However, I don't want a web dependency. I want jquery within the app.
I've copied jquery.min.js to the web/static/js directory. And referenced it in app.html.eex like so:
<script src="<%= static_path(@conn, "/js/jquery.min.js") %>"></script>
It doesn't work.
Copying jquery.min.js to app.js doesn't work either.
Interesting enough when I place the JS between script tags directly in app.html.eex, it works.
Only a direct link from the cloud and/or placing the JS between a script tag in app.html.eex is working??
Update:
Brunch is copying the JS to app.js in the priv directory. But the application doesn't seem to have access to it.
What am I doing wrong.