Tuesday, March 21, 2006

Puzzling behavior

Was debugging some code today that was working on a windows box, but was not working in a Linux box.

class MapController
model :Roads

def draw_roads
render :text => "No Routes to show" if no_roads
end
end
On the linux box, draw_roads would always look for a draw_roads.rhtml template and go ahead with the execution. Whereas in a Windows box, the check would be performed and accordingly a render of "No Routes to Show" would happen or draw_roads.rhtml would have gotten rendered.

After some debugging and placing of puts statements in the code figured that the issue was with the

model :Roads

bit. It should have been

model :roads

But still not sure why this worked on a windows box and not a linux box !!

1 Comments:

Anonymous Anonymous said...

It is probably because the windows box is not case sensitive, but linux is. So Roads.rb on windows will match roads.rb, whereas on linux they won't match.

Great to see you guys blogging this stuff!

9:48 AM  

Post a Comment

<< Home