# Strange Error

**URL:** <https://www.ruby-forum.com/t/strange-error/180243>\
**Category:** Rails\
**Created:** [December 15, 2009, 5:23pm UTC](https://www.ruby-forum.com/t/strange-error/180243 "2009-12-15T17:23:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mercurius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@mercurius](https://www.ruby-forum.com/u/mercurius)\
**Post date:** [December 15, 2009, 5:23pm UTC](https://www.ruby-forum.com/t/strange-error/180243/1 "2009-12-15T17:23:00Z")

</div>

My local version of a show page mirrors a live version.

Here is a piece of sample code that is the potential trouble causer:

\<%= link\_to\_function (scale\_image\_tag(@portfolio.picture1, :width =\>  
101, :height =\> 75), :onMouseOver =\> “show\_picture(1);”) %\>

This work’s on my local version perfectly. I uploaded it to the live  
version and it fails to work. On observing the Source code, I’ve noticed  
the following:

> Local:

![100_0532w101h75](https://test.ruby-forum.com/images/gallery/100_0532w101h75.JPG?1202992296)

> Live:

Can anyone help me diagnose this?

---

<div class="post-metadata">

**Author:** ![mercurius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@mercurius](https://www.ruby-forum.com/u/mercurius)\
**Post date:** [December 15, 2009, 5:56pm UTC](https://www.ruby-forum.com/t/strange-error/180243/2 "2009-12-15T17:56:33Z")

</div>

I’m guessing the problem is with the Rails versions on the two versions.  
Does anyone have any idea why the syntax above doesn’t work in Rails  
2.3.5, please?

---

<div class="post-metadata">

**Author:** ![mercurius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@mercurius](https://www.ruby-forum.com/u/mercurius)\
**Post date:** [December 15, 2009, 6:08pm UTC](https://www.ruby-forum.com/t/strange-error/180243/3 "2009-12-15T18:08:16Z")

</div>

Pale H. wrote:

> I’m guessing the problem is with the Rails versions on the two versions.  
> Does anyone have any idea why the syntax above doesn’t work in Rails  
> 2.3.5, please?

The live version should never be a higher revision than the development  
version, and you just ran into the reason why.  
The correct thing to do here is definitely to bring your live Rails  
revision back down to the development Rails revision. After that, maybe,  
go to [http://weblog.rubyonrails.org/](http://weblog.rubyonrails.org/) to find out, from all the 2.3.5  
commits, what changed that could explain this…

---

<div class="post-metadata">

**Author:** ![mercurius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@mercurius](https://www.ruby-forum.com/u/mercurius)\
**Post date:** [December 16, 2009, 2:32pm UTC](https://www.ruby-forum.com/t/strange-error/180243/4 "2009-12-16T14:32:00Z")

</div>

Pale H. wrote:

> Aldric G. wrote:
> 
> > The live version should never be a higher revision than the development  
> > version, and you just ran into the reason why.  
> > The correct thing to do here is definitely to bring your live Rails  
> > revision back down to the development Rails revision. After that, maybe,  
> > go to [http://weblog.rubyonrails.org/](http://weblog.rubyonrails.org/) to find out, from all the 2.3.5  
> > commits, what changed that could explain this…
> 
> I’ve fixed it but you are right.

So… What was it? 🙂

---

<div class="post-metadata">

**Author:** ![mercurius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@mercurius](https://www.ruby-forum.com/u/mercurius)\
**Post date:** [December 16, 2009, 9:46am UTC](https://www.ruby-forum.com/t/strange-error/180243/5 "2009-12-16T09:46:59Z")

</div>

Aldric G. wrote:

> The live version should never be a higher revision than the development  
> version, and you just ran into the reason why.  
> The correct thing to do here is definitely to bring your live Rails  
> revision back down to the development Rails revision. After that, maybe,  
> go to [http://weblog.rubyonrails.org/](http://weblog.rubyonrails.org/) to find out, from all the 2.3.5  
> commits, what changed that could explain this…

I’ve fixed it but you are right.

---

<div class="post-metadata">

**Author:** ![mercurius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@mercurius](https://www.ruby-forum.com/u/mercurius)\
**Post date:** [December 16, 2009, 3:07pm UTC](https://www.ruby-forum.com/t/strange-error/180243/6 "2009-12-16T15:07:47Z")

</div>

Aldric G. wrote:

> Pale H. wrote:
> 
> > Aldric G. wrote:
> > 
> > > The live version should never be a higher revision than the development  
> > > version, and you just ran into the reason why.  
> > > The correct thing to do here is definitely to bring your live Rails  
> > > revision back down to the development Rails revision. After that, maybe,  
> > > go to [http://weblog.rubyonrails.org/](http://weblog.rubyonrails.org/) to find out, from all the 2.3.5  
> > > commits, what changed that could explain this…
> > 
> > I’ve fixed it but you are right.
> 
> So… What was it? 🙂

I used different syntax for the link as I requested. See below:

> Local:

\<%= link\_to\_function (scale\_image\_tag(@portfolio.picture1, :width =\>  
101, :height =\> 75), :onMouseOver =\> “show\_picture(1);”) %\>

> Live:

\<%= link\_to scale\_image\_tag @portfolio.picture1, :width =\> 101, :height  
=\> 75, :vspace=\>“0”, :hspace=\>“0”, :border=\>“0”, :onmouseover =\>  
“show\_picture(1);” %\>

---

<div class="post-metadata">

**Author:** ![mercurius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@mercurius](https://www.ruby-forum.com/u/mercurius)\
**Post date:** [December 17, 2009, 5:28pm UTC](https://www.ruby-forum.com/t/strange-error/180243/7 "2009-12-17T17:28:16Z")

</div>

Marnen Laibow-Koser wrote:

> […]  
> Great. Now the lecture: get out of the habit of using onmouseover  
> handlers in your HTML. HTML files should never contain JavaScript;  
> rather, you should have the JavaScript in an external file and apply it  
> to the DOM. This helps maintenance and testability (read about  
> unobtrusive JavaScript for more information.
> 
> Best,  
> –Â  
> MarnenÂ Laibow-Koser  
> [http://www.marnen.org](http://www.marnen.org)  
> removed\_email\_address@domain.invalid

Alright - thank you, Marnen. I’ll bare that in mind.

---

<div class="post-metadata">

**Author:** ![mercurius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@mercurius](https://www.ruby-forum.com/u/mercurius)\
**Post date:** [December 16, 2009, 5:08pm UTC](https://www.ruby-forum.com/t/strange-error/180243/8 "2009-12-16T17:08:30Z")

</div>

Pale H. wrote:  
[…]

> I used different syntax for the link as I requested. See below:
> 
> > Local:
> 
> \<%= link\_to\_function (scale\_image\_tag(@portfolio.picture1, :width =\>  
> 101, :height =\> 75), :onMouseOver =\> “show\_picture(1);”) %\>
> 
> > Live:
> 
> \<%= link\_to scale\_image\_tag @portfolio.picture1, :width =\> 101, :height  
> =\> 75, :vspace=\>“0”, :hspace=\>“0”, :border=\>“0”, :onmouseover =\>  
> “show\_picture(1);” %\>

Great. Now the lecture: get out of the habit of using onmouseover  
handlers in your HTML. HTML files should never contain JavaScript;  
rather, you should have the JavaScript in an external file and apply it  
to the DOM. This helps maintenance and testability (read about  
unobtrusive JavaScript for more information.

Best,  
–Â  
MarnenÂ Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
