Displaying images from database

Is there any way to emulate that :id.jpg routing functionality without
edge rails? I can't justify edge for only that, but would really like
.jpg extensions on the images.

Thanks,
Chad