I was just wondering what the advantage is to using the image_tag helper
over the standard <img> html tag?
Also the helper seems to place a load of random numbers on the end, eg
'?63565665' why does it do this and what are they for?
There are a few reasons to use image_tag over <img>. One is easy typing for a programmer. Compare:
image_tag('foo') vs. <img src="/images/foo.png" />
Which would you rather type? Another is asset timestamping comes for free. Those are those funny numbers on the end. They are the timestamp of the file. This allows you to enable HTTP caching of images forever but still allow them to expire when you update the image
A final reason is you can configure your static assets to be stored on a different server that is built to serve static resources quickly. A simple config change and all your images change from:
<img src="/images/foo.png?63565665" />
<img src="http://assets.yourcompany.com/images/foo.png?63565665" />
You don't have to change all that code manually. Even if you choose to serve the static assets from the same server as dynamic requests you might still want to do this because the popular browsers limit the number of connections to each host to three requests. Setting up different virtual hosts (even if they are actually the same server) allows you to bypass this limit so your page can be loaded quicker.
You get all that and more from using image_tag instead of <img>.