Strange Error

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

Live:

Can anyone help me diagnose this?

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?

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/ to find out, from all the 2.3.5
commits, what changed that could explain this…

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/ 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? :slight_smile:

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/ to find out, from all the 2.3.5
commits, what changed that could explain this…

I’ve fixed it but you are right.

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/ 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? :slight_smile:

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);” %>

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
[email protected]

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

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
[email protected]