Next, always use lower case file extensions - jpg. That’s just for
style, but it
helps us diagnose problems…
http://localhost:3000/images/green.JPG.?1228211220
not work, error message as below, I don’t know why there is a “.”
appended after the filename.
No route matches “/images/green.JPG.” with {:method=>:get}
The image is located at public\images
The filename is green.JPG
http://localhost:3000/images/green.JPG.?1228211220
not work, error message as below, I don’t know why there is a “.”
appended after the filename.
No route matches “/images/green.JPG.” with {:method=>:get}
The image is located at public\images
The filename is green.JPG
Thank you for your help.
Valentino
I renamed the file extension to lower case. i.e. green.jpg
Not work either
Next, always use lower case file extensions - jpg. That’s just for
style, but it
helps us diagnose problems…
http://localhost:3000/images/green.JPG.?1228211220
not work, error message as below, I don’t know why there is a “.”
appended after the filename.
No route matches “/images/green.JPG.” with {:method=>:get}
Sounds to me like that extra . is the problem. The big question
is why image_tag adds that extra dot. It shouldn’t. Have you
looked at the source code for image_tag? You didn’t accidentally
override it or anything like that?
Sounds to me like that extra . is the problem. The big question
is why image_tag adds that extra dot. It shouldn’t. Have you
looked at the source code for image_tag? You didn’t accidentally
override it or anything like that?
mcv.
Thank you for your help
Could you tell me where the source code located?
In asset_tag_help.rb, the problem might cause from *****(see below
code). I am using Rails 2.1.2, I will try the latest version to see the
problem has been fixed. Thanks all
The thing is, source += “.#{ext}” will only be executed if ext is
not nil. In this case, I think ext is nil, so this should be causing
the problem.
But if something is really mysterious (and in Rails it often is),
then I just add lots of debug statements and see what really happens.
puts all the names of methods that are called, and all relevant
variables (or just use the debugger, of course!), and see where the
dot is added. You may have found a bug in Rails.
end
rewrite_asset_path(source)
end
end
All this code is also capable of changing source. I’ve got no idea
what it does, but if you just puts the value of source after each
one, you’ll see where the dot gets added.
That’s the only advice I can give you. Other than that, I’m
stumped.
mcv.
Thank you mcv
I solved the problem finally by update the rails to 2.2.2
I also learned a lesson when I was trying to identify the problem.
The thing is, source += “.#{ext}” will only be executed if ext is
not nil. In this case, I think ext is nil, so this should be causing
the problem.
But if something is really mysterious (and in Rails it often is),
then I just add lots of debug statements and see what really happens.
puts all the names of methods that are called, and all relevant
variables (or just use the debugger, of course!), and see where the
dot is added. You may have found a bug in Rails.
end
rewrite_asset_path(source)
end
end
All this code is also capable of changing source. I’ve got no idea
what it does, but if you just puts the value of source after each
one, you’ll see where the dot gets added.
That’s the only advice I can give you. Other than that, I’m
stumped.
mcv.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.