title: how to use output of helper method as value in haml hash?
body: <p>I have a button and I want to set its onClick attribute dynamically each page load.  I want to use application_helper to give it a custom javascript every time.  It seems difficult to do because the Javascript is going to need access to stuff that only the ruby has access to.  I wanted to build up a custom javascript with the application_helper module and yield the result of calling the helper method as the value to the onClick key in the Haml hash:</p>
  
  <p>In application.html.haml:</p>
  
  <pre><code>%button{class: "user_navigation_menu_item", onClick: =  gimme_my_custom_javascript}
  </code></pre>
  
  <p>In application_helper,rb:</p>
  
  <pre><code>def gimme_my_custom_javascript
    javascript = "function(){"
    javascript +="alert('yo!');"
    javascript+="}"
  end
  </code></pre>
  
  <p>Haml is yelling at me: 'unexpected "="'</p>
  
  <p>How do I do what I am trying to do?</p>
  
  <p>Thank you</p>