I'm trying to load some javascript in my application page using a named yield block, but the code is duplicated because of a generic yield that load my view pages. something like that:
-----Code present in views-----
<% content_for :bottom_scripts do %>
<script type="text/javascript">
Some Javascripts
</script>
<% end %>
------Code in my application page-----
<div id = "body">
<%= yield %>
</div>
<%= yield :bottom_scripts %>
The script code is printed twice, but I need it just printed in the second yield, any thoughts?