Forum: Ruby on Rails Call Javascript

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
9606f903c3545c03403affcc8e94ffcc?d=identicon&s=25 Intern ruby (intern_ruby)
on 2009-04-06 20:23
I have following code. I have included the javascript file at the top of
page. Still it is giving errors

    <%= f.label :content %><br />
    <%= f.text_area :content, {onkeyup="strcount(1);chngcnt(1);"
onkeydown="chngcnt(1);" onblur="chngcnt(1);" onfocus="chngcnt(1);} %>

compile error
odd number list for Hash
...ount(1);chngcnt(1);" onkeydown="chngcnt(1);" onblur="chngcnt...

Please help me in calling the javascript function on following events.
Where Am I wrong ?
9606f903c3545c03403affcc8e94ffcc?d=identicon&s=25 Intern ruby (intern_ruby)
on 2009-04-06 20:45

    <%= f.label :content %><br />
    <%= f.text_area :content,
,:onkeydown=>"chngcnt(1);" ,:onblur=>"chngcnt(1);",
:onfocus=>"chngcnt(1);" %>

Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2009-04-06 21:03
(Received via mailing list)
>     <%= f.text_area :content, {onkeyup="strcount(1);chngcnt(1);"
> onkeydown="chngcnt(1);" onblur="chngcnt(1);" onfocus="chngcnt(1);} %>

The errors come from Ruby - inside the <%%> tag - not from Javascript.

Google for [ruby option hash], and compare it to what you wrote. You
need more
symbols and arrows in there...
This topic is locked and can not be replied to.