<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.