# Javascript call fails when it renders a partial which has a javascript call

**URL:** <https://www.ruby-forum.com/t/javascript-call-fails-when-it-renders-a-partial-which-has-a-javascript-call/176339>\
**Category:** Rails\
**Created:** [September 29, 2009, 9:19am UTC](https://www.ruby-forum.com/t/javascript-call-fails-when-it-renders-a-partial-which-has-a-javascript-call/176339 "2009-09-29T09:19:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![darkhelmet](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b19c9b/32.png) [@darkhelmet](https://www.ruby-forum.com/u/darkhelmet)\
**Post date:** [September 29, 2009, 9:19am UTC](https://www.ruby-forum.com/t/javascript-call-fails-when-it-renders-a-partial-which-has-a-javascript-call/176339/1 "2009-09-29T09:19:44Z")

</div>

So I have a setup like this:

Render a view which has a link\_to\_function which does an insert\_html,  
and the partial that it inserts has a link\_to\_function which does  
something like a page.call(‘alert’, ‘foo’)

The ‘foo’ is, I believe, quoted improperly, thereby causing the first  
link\_to\_function to fail when you click the link. Make sense?

I replicated this on a basic app. Is this a bug or working as  
advertised because you’re just not supposed to do stuff like that? I  
doesn’t make sense that it shouldn’t work, and I think it’s a bug.
