d-i/half-pipe — pull request #58 by Eleo (2013-11-05 17:03:04+00:00)
Title: use Rails asset helpers

So the previous pull request worked fine locally but didn't work in our staging environment. The former environment uses local file storage for uploaded files, while the latter uses AWS, which means the src for images would be a full URL. The workaround I previously submitted will not help in such a case.

I dug into the Rails source to figure out how paths for `image_tag` were generated. Rails assumes the public directory for images is /images; half-pipe needs merely /assets/images. Overriding these paths allows us to use `image_tag` without overriding the method itself. I feel that this is a better approach at least for now, since the logic for asset URLs is non-trivial and overriding `image_tag` bypassed the logic that handles many different cases.