%= content_for :css do %> /* Need separate style for each instance of svg div because javascript will manipulate the properties. */ #<%= divId %> { padding-left: 3px; overflow: auto; border: solid; border-width: 1px; border-color: gray; position: absolute; left: 25px; right: 25px; } path:hover { stroke-width: 5; } path { stroke-linecap: round; } <% end %> <%= content_for :js do %> $(window).on('load', function() { $(window).on('load resize scroll', function () { graph_zoom("<%= divId %>","<%=svgId %>", 1) } ); }); <% end %>