So in the Assets folder there are two folders for javascripts and stylesheets.
So I added a spike.js and a CSS file of spikecss.css to those folders and wrote some Javascript and CSS code fin them.
Now I am in the index.html page and writing something like this? Which doesn't work. How do I wire all these thing together to work?
This is a test app mostly for the javascript side of the deal so I really don't have models, controllers,views at this point. I am drawing D3 chart in the JavaScript file so I just want to show them when I hit the webpage
Javascript file:
var data = [4, 8, 15, 16, 23, 42];
var chart = d3.select("body").append("div")
.attr("class", "chart");
chart.selectAll(chart)
.data(data)
.enter().append("div")
.style("width", function(d){return d*5 +"px";});
Index.html file:
<!DOCTYPE html>
<html>
<head>
<title>Here we go</title>
</head>
<body>
javascript_include_tag :defaults, "spike"
</body>
</html>