title: How to include CoffeeScript in Rails
body: <p>So CoffeeScript has shipped with Rails since 3.1? Fantastic! I'm getting into the syntax. I like simplicity.</p>
  
  <p>And yet, I can't seem to figure out how to include it on my site. I've tried including it between  and that didn't work.</p>
  
  <p>I have one .erb file I want this to be in, new.html.erb (obviously, this is a Rails app):</p>
  
  <pre><code>&lt;script type="text/coffeescript"&gt;
  # Countdown to date script provided by JavaScriptKit.com
  # http://www.javascriptkit.com/script/script2/count.shtml
  
  montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
  
  countdown(yr,m,d) -&gt;
    today=new Date()
    todayy=today.getYear()
  
  if (todayy &lt; 1000)
    todayy+=1900
    todaym=today.getMonth()
    todayd=today.getDate()
    todaystring=montharray[todaym]+" "+todayd+", "+todayy
    futurestring=montharray[m-1]+" "+d+", "+yr
  
    difference=(Math.round((Date.parse(futurestring)-Date.parse(todaystring))/(24*60*60*1000))*1)
  
  if (difference==0) and document.write(current)
    elseif (difference&gt;0) document.write("ONLY "+difference+" DAYS LEFT!")
  
  countdown(2012,4,30)
  
  &lt;/script&gt;​
  </code></pre>
  
  <p>And it doesn't show up at all. Ideas?</p>