A couple of random Rails 1.1 tips 4

Posted by brian Thursday, April 13, 2006 15:32:00 GMT

Here are a couple quick tips that I discovered (the hard way) over the last few days.

  • script/console doesn’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 &lt;img src="rails.png?1143664135" /&gt;. 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!

Comments

Leave a response

  1. Ryan Platte   April 13, 2006 @ 10:19 PM

    That JavaScript looks like it could be modified to also match against ".png?", no?

  2. Brian   April 14, 2006 @ 01:27 AM

    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.

  3. RLivsey   April 14, 2006 @ 04:06 PM

    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

  4. Paul O'Shannessy   April 27, 2006 @ 09:11 AM

    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.

Comment


(won't be published)