<% content_for :extra_head do %>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript" charset="utf-8">
$(function() {
  setup_visualize();
  select_vis($("span.vis_selection")[0]);
  $( "#visualizations" ).accordion({heightStyle: "content"});
});

google.load("visualization", "1", {packages:["corechart"]});
</script>
<% end %>

<div id="Prismabob">
  <h1><%= @prism.title.html_safe %></h1>
  <h2><%= @prism.author %></h2>

  <div class="text">
    <%= @prism.content.html_safe %>
  </div>
</div>
<div id="sidebar">
  <%= render 'vizopts' %>
  <p><%= render 'cc_license' %></p>
  <p id="viz-count">
    <span><% if @prism.word_markings.map(&:user_id).uniq != nil %><%=@prism.word_markings.map(&:user_id).uniq.size %></span> <% if @prism.word_markings.map(&:user_id).uniq.size == 1%>user <% else%>users <%end%>contributed to this visualization.<% end %>
  </p>
</div>


<div id="Prismabob">
  <h1><%= @prism.title.html_safe %></h1>
  <h2><%= @prism.author %></h2>

  <div class="text">
    <%= @prism.content.html_safe %>
  </div>
</div>
<div id="sidebar">
  <%= render 'vizopts' %>
  <p><%= render 'cc_license' %></p>
  <p id="viz-count">
    <span><% if @prism.word_markings.map(&:user_id).uniq != nil %><%=@prism.word_markings.map(&:user_id).uniq.size %></span> <% if @prism.word_markings.map(&:user_id).uniq.size == 1%>user <% else%>users <%end%>contributed to this visualization.<% end %>
  </p>
</div>

<%# content_for :extra_head do %>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript" charset="utf-8">
$(function() {
    setup_visualize();
    console.log('visualization set up');
    select_vis($("span.vis_selection")[0]);

    $( "#visualizations" ).accordion({heightStyle: "content"});
});

google.load("visualization", "1", {packages:["corechart"]});
</script>
<%# end %>


Remove content_for block from visualize
Remove content_for block from visualize

content_for is not applied in caches. See http://apidock.com/rails/ActionView/Helpers/CaptureHelper/content_for
