I have a page, where I load a partial (that contains a form) dynamically.
So after that you click in a button, via jQuery I do a get, get the form and I change the html of a div. Everything works great.
The problem is I have some javascript that I added inline on the partial and I would like to remove it. So in my partial I made something like:
<% content_for :header %>
<%= javascript_include_tag 'myscript' %>
<%end%>
For sure in my layout I have the yield header. Actually I can see my scripting being included but the content of $(function(){});
get never executed. Any tip about it? Any better way to do it? I want to move my JavaScript to external js files but for now, I couldn't find a good way to do it.