Reputation: 267
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.
Upvotes: 1
Views: 1095
Reputation: 10395
Sounds like a problem with the asset pipeline.
Try adding
config.serve_static_assets = true
In development.rb
Upvotes: 1