# Prototype Helper Method Name Clash

**URL:** <https://www.ruby-forum.com/t/prototype-helper-method-name-clash/115567>\
**Category:** Rails\
**Created:** [September 26, 2007, 12:03pm UTC](https://www.ruby-forum.com/t/prototype-helper-method-name-clash/115567 "2007-09-26T12:03:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3be4f8/32.png) [@jrm](https://www.ruby-forum.com/u/jrm)\
**Post date:** [September 26, 2007, 12:03pm UTC](https://www.ruby-forum.com/t/prototype-helper-method-name-clash/115567/1 "2007-09-26T12:03:24Z")

</div>

Hi,

I am using Open Flash Charts ([http://teethgrinder.co.uk/open-flash-](http://teethgrinder.co.uk/open-flash-)  
chart/) in a rails project.

Once the flash movie is loaded the dom element of the movie supports a  
javascript function called “reload” to allow you to get the flash  
movie to reload a url that supplies chart data. This is a cool  
feature and I want to use it to make switching between chart data  
really responsive.

I have set up some link\_to\_remote links that call a controller method  
that contains a simple inline rjs statement to call the “reload”  
function on the dom id of the flash movie:

def reload\_data  
render(:update) { |page|  
page[params[:chart\_id]].reload(params[:data\_path])}  
end

This is where I found that the JavaScriptElementProxy class in the  
prototype helper contains a “reload” method - which hides the native  
reload function on the dom element.

My question: How can I bypass the JavaScriptElementProxy methods  
without hacking the ActionPack code.

Of course I could skip the Ajax links and just do pure client side  
onclick events, but I would like to know how do deal with the issue I  
have found.

Thanks in advance rail dudes…

James

---

<div class="post-metadata">

**Author:** ![jrm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/3be4f8/32.png) [@jrm](https://www.ruby-forum.com/u/jrm)\
**Post date:** [November 17, 2007, 6:32pm UTC](https://www.ruby-forum.com/t/prototype-helper-method-name-clash/115567/2 "2007-11-17T18:32:47Z")

</div>

## use direct javascript

## page\<\<“$(‘chart\_id’).reload(#{params[:data\_path])})”

try using “call”,

call(function, \*arguments, &block)

Calls the JavaScript function, optionally with the given arguments.

If a block is given, the block will be passed to a new  
JavaScriptGenerator; the resulting JavaScript code will then be wrapped  
inside function() { â€¦ } and passed as the called functionâ€˜s final  
argument.

jrm wrote:

> Hi,
> 
> I am using Open Flash Charts ([Open Flash Chart – Teeth Grinder UK](http://teethgrinder.co.uk/open-flash-)  
> chart/) in a rails project.
> 
> Once the flash movie is loaded the dom element of the movie supports a  
> javascript function called “reload” to allow you to get the flash  
> movie to reload a url that supplies chart data. This is a cool  
> feature and I want to use it to make switching between chart data  
> really responsive.
> 
> I have set up some link\_to\_remote links that call a controller method  
> that contains a simple inline rjs statement to call the “reload”  
> function on the dom id of the flash movie:
> 
> def reload\_data  
> render(:update) { |page|  
> page[params[:chart\_id]].reload(params[:data\_path])}  
> end
> 
> This is where I found that the JavaScriptElementProxy class in the  
> prototype helper contains a “reload” method - which hides the native  
> reload function on the dom element.
> 
> My question: How can I bypass the JavaScriptElementProxy methods  
> without hacking the ActionPack code.
> 
> Of course I could skip the Ajax links and just do pure client side  
> onclick events, but I would like to know how do deal with the issue I  
> have found.
> 
> Thanks in advance rail dudes…
> 
> James
