Include Javascript on Certain Pages in Phoenix Framework Application : <p>I've got a bit of Javascript that I only want to include on certain pages in my Phoenix application.</p>

<p>Right now I've got the Javascript inside a script tag in <code>myapp/web/templates/post/form.html.eex</code>.</p>

<p>I understand that I can move the JavaScript to <code>web/static/js/app.js</code> ...but I don't want to include the Javascript on every page (it's only required on 2 specific pages).</p>

<p>What's the best way to load this section of Javascript on certain pages in my application without duplication the code and violating the DRY principle? </p>
