Click events not working in Rails view
- by Fdr
I have following view (html.erb):
<h3>My view</h3>
<script>
function test() { alert("hello"); }
</script>
<input type="button" onClick="test();" value="test" />
For reasons I cannot understand the onClick event never gets fired when I access the view through rails(tried static apache hosting - no problems there).
Here is rendered html: http://pastebin.com/LmGysgUG
I feel quite stupid, is this something to do the way Rails renders views?