Forum: Ruby on Rails javascript function needs rails variable

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
41c5f1c3c0fc8900b307e25777e1a2ba?d=identicon&s=25 Rabia (Guest)
on 2009-01-28 07:03
(Received via mailing list)
<script type="text/javascript">


    document.getElementById('h').checked=true;
    show_coords(<%= @pic_comments.to_json %>,"main",'<%=$domain%>/
users/update_picture_div',<%= @picture.id %>)

 </script>
I have implement this but rails variables are not working.
D69d23d8e811e8ab2a8593380d6ede63?d=identicon&s=25 Jeff Emminger (jemminger)
on 2009-01-28 16:42
(Received via mailing list)
This will only work if that script block is in an .erb template.
41c5f1c3c0fc8900b307e25777e1a2ba?d=identicon&s=25 Rabia Akhtar (Guest)
on 2009-01-29 05:24
(Received via mailing list)
it starts working
Cheers
Rabia Akhtar
This topic is locked and can not be replied to.