Ruby on rails -- Render partial file inside .js.erb file
===

In the HTML header this small javascript works:

application.html.erb

    <script type="text/javascript">
                   alert("<%= escape_javascript(render('resources/positions')) %>");
    </script>

But When I tried to put the same code in a js.erb file, it doesn't work.

I tried to inlcude the file, but not working both ways:

    <script src="/assets/resources.js.erb" type="text/javascript"></script>
    <%= javascript_include_tag 'resources' %>

app/assets/javascripts/resources.js.erb

    alert("<%= escape_javascript(render('resources/positions')) %>");

any ideas ?

Thanks in advance for any help.


    