# Stange behaviour with internet explorer

**URL:** <https://www.ruby-forum.com/t/stange-behaviour-with-internet-explorer/122361>\
**Category:** Rails\
**Created:** [December 6, 2007, 11:06pm UTC](https://www.ruby-forum.com/t/stange-behaviour-with-internet-explorer/122361 "2007-12-06T23:06:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chillicoder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a4c791/32.png) [@chillicoder](https://www.ruby-forum.com/u/chillicoder)\
**Post date:** [December 6, 2007, 11:06pm UTC](https://www.ruby-forum.com/t/stange-behaviour-with-internet-explorer/122361/1 "2007-12-06T23:06:52Z")

</div>

Hi!

I’m developing an application with Rails 1.2.6 and I’ve facing a weird  
problem.

In a form, I’m using link\_to\_function that is aggregating a :partial,  
the code is as follows:

 \<%= render :partial =\> 'bonificacion', :collection =\> @convenio.bonificaciones %\> 

| Marca | Porcentaje | Objetivo Mensual | Destino |
| --- | --- | --- | --- |

 \<%= link\_to\_function 'Agregar Bonificacion' do |page| page.insert\_html :bottom, :bonificaciones, :partial =\>'bonificacion', :object =\> Bonificacion.new end %\>

The :partial’s code:  
  
\<% fields\_for “convenio[bonificaciones\_attributes]  
[]”,bonificacion do |bonificacion\_form| %\>  
\<%=  
bonificacion\_form.collection\_select :marca\_id,@marcas, :alternate\_id,  
:valor  
%\>  
\<%= bonificacion\_form.text\_field :porcentaje %\>  
\<%= bonificacion\_form.text\_field :objetivo\_mensual %\>  
\<%=  
bonificacion\_form.select :destino,Bonificacion::DESTINO %\>  
\<%= link\_to\_function  
“Quitar”,"try{this.up(‘.bonificacion’).remove()} catch(e) {alert(‘JS  
error\n’

- e.name + ‘\n’ + e.message); throw e}" %\>  
\<%= link\_to\_function “this.up”, “try{this.up(1)} catch(e)  
{alert(‘JS error\n’ + e.name + ‘\n’ + e.message); throw e}” %\>  
\<% end %\>  

The 1st link\_to\_function is using this.up(‘.bonificacion’).remove()  
working w/o any problem with firefox and opera but not with internet  
explorer.  
Using try…catch and the alert found internet explorer doesn’t  
recognize ‘this.up’ as a valid method, AFAIK is a prototype  
(Element.up) method but can not understand the reason for error. I  
used the second link\_to\_function serve to pinpoint the error to  
Element.up

Any help? recommendation? guidance?  
If any additional information is required, pls ask me.

Thank you in advance.

Saludos,

Martín Trejo Chávez

> **[ChilliCoder](http://chilli-coder.blogspot.com)**
>
> Anotaciones de diversos temas relacionados con código abierto, metodologías de desarrollo y programación con Ruby on Rails
