title: Calling functions defined with coffee script?
body: <p>I have the following coffeescript code to generate and alert box:</p>
  
  <pre><code>show_alert = () -&gt;
    alert("Hello! I am an alert box!")
  </code></pre>
  
  <p>which compiles to:</p>
  
  <pre><code>(function() {
    var show_alert;
  
    show_alert = function() {
      return alert("Hello! I am an alert box!");
    };
  
  }).call(this);
  </code></pre>
  
  <p>in my html I have the following</p>
  
  <pre><code>&lt;input onclick='show_alert()' type='button' value='Show alert box' /&gt;
  </code></pre>
  
  <p>However, no alert box shows?  The following is the html copied from the browser:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;Test Rails Application&lt;/title&gt;
      &lt;style type='text/css'&gt;.application h1 {
    color: lime; }
  &lt;/style&gt;
      &lt;script type='text/javascript'&gt;(function() {
    var show_alert;
  
    show_alert = function() {
      return alert("Hello! I am an alert box!");
    };
  
  }).call(this);
  &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;h1&gt;Hello from applicaiton.html.haml&lt;/h1&gt;
      &lt;div class='application'&gt;&lt;h1&gt;Hello World&lt;/h1&gt;
  &lt;input onclick='show_alert()' type='button' value='Show alert box' /&gt;
  &lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Why am I not able to get an alert box to show up?</p>