Click events not working in Rails view
Posted
by
Fdr
on Stack Overflow
See other posts from Stack Overflow
or by Fdr
Published on 2012-03-28T17:12:43Z
Indexed on
2012/04/02
5:30 UTC
Read the original article
Hit count: 210
html5
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?
© Stack Overflow or respective owner