A couple of random Rails 1.1 tips 4
Here are a couple quick tips that I discovered (the hard way) over the last few days.
script/consoledoesn’t work with Rails 1.1 and Ruby 1.8.2 on Windows. Either upgrade to Ruby 1.8.4 or try this hack.
- AssetTagHelpers were modified so that the time stamp of the asset file is included as a request parameter in the resulting HTML. For example,
<%= image_tag("rails") %>now results in HTML like<img src="rails.png?1143664135" />. Very nice for helping browser caching issues. Not nice when you’ve implemented a hack for IE PNG transparency that scours your HTML for image files ending in .png!



That JavaScript looks like it could be modified to also match against ".png?", no?
Yes. In the existing code, it's looking for "PNG" as the last three characters of the filename. That could easily be changed to look for ".png" anywhere in the src attribute though.
Another way to get script/console to work is to update irb.bat to the version from 1.8.4
I can't upgrade due to other problems which are caused, but have been running edge rails fine since patching irb.bat
See this blog post for more details:
http://livsey.org/2006/03/27/scriptconsole-with-edge-rails-on-windows-with-182/
Or the ticket where I have posted the patched batch file:
http://dev.rubyonrails.org/ticket/4362
I'm running Rails 1.1 and Ruby 1.8.2 on Windows and for some reason, I seem to be immune from this failure of
script/console. I still haven't figured out why or how yet, but I'm glad. My host still is running Ruby 1.8.2 so it's good to be able to test in a similar environment.