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.
Rabia (Guest)
on 2009-01-28 08: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.
Jeff E. (Guest)
on 2009-01-28 17:42
(Received via mailing list)
This will only work if that script block is in an .erb template.
Rabia Akhtar (Guest)
on 2009-01-29 06:24
(Received via mailing list)
it starts working
Cheers
Rabia Akhtar
This topic is locked and can not be replied to.