Take the 2-minute tour ×  image_path returns a path only (no
host).  The url_for helper won't accept a single path, so
something like url_for(image_path('image.png')) wouldn't work.
While the internal url_for in ActionDispatch::Http::Url.url_for
would appear to do the trick (source), there doesn't seem to be
a public interface for it.  How should I go about doing it?
Ultimately, it'd be nice to have a function like image_url that
works like url_for does for routes so that I could call
image_url('image.png') and get the absolute URL given all of the
default_url_options.  share|improve this question this blog has
a snippet that you can use: stick.gk2.sk/blog/2009/12/image_url-
function-in-ruby-on-rails –  Spike Gronim Jun 27 '11 at 23:17
@Spike: the shortcoming with that approach is that it ignores
the default url options. There would, for instance, be no way to
override the inferred request params either manually or through
a default_url_options hash in the app configuration. –  Steven
Xu Jun 28 '11 at 1:50 @Sp