def image_tag(img, opts={})
      return "" if img.blank?
      if img[0].chr == '/'
        opts[:src] = "#{Merb::Config[:path_prefix]}#{img}"
      else
        opts[:path] ||=
          if img =~ %r{^https?://}
            absolute = true
            ''
          else
            "#{Merb::Config[:path_prefix]}/images/"
          end
        opts[:src] ||= opts.delete(:path) + img
      end

      if AssetsMixin.append_random_query_string?(opts.delete(:reload), !absolute)
        opts[:src] += opts[:src].include?('?') ? "&#{random_query_string}" : "?#{random_query_string}"
      end

      %{<img #{ opts.to_xml_attributes } />}
    end
def image_tag(img, opts={})
      return "" if img.blank?
      if img[0].chr == '/'
        opts[:src] = "#{Merb::Config[:path_prefix]}#{img}"
      else
        opts[:path] ||=
          if img =~ %r{^https?://}
            absolute = true
            ''
          else
            "#{Merb::Config[:path_prefix]}/images/"
          end
        opts[:src] ||= opts.delete(:path) + img
      end

      if AssetsMixin.append_random_query_string?(opts.delete(:reload), !absolute)
        opts[:src] += opts[:src].include?('?') ? "&#{random_query_string}" : "?#{random_query_string}"
      end

      %{<img #{ opts.to_xml_attributes } />}
    end
==== Parameters
 img<~to_s>:: The image path.
 opts<Hash>:: Additional options for the image tag (see below).

 ==== Options (opts)
 :path<String>::
   Sets the path prefix for the image. Defaults to "/images/" or whatever
   is specified in Merb::Config. This is ignored if img is an absolute
   path or full URL.
 :reload<Boolean>::
   Override the Merb::Config[:reload_templates] value. If true, a random query param will be appended
   to the image url

 All other options set HTML attributes on the tag.

 ==== Examples
   image_tag('foo.gif')
   # => <img src='/images/foo.gif' />

   image_tag('foo.gif', :class => 'bar')
   # => <img src='/images/foo.gif' class='bar' />

   image_tag('foo.gif', :path => '/files/')
   # => <img src='/files/foo.gif' />

   image_tag('http://test.com/foo.gif')
   # => <img src="http://test.com/foo.gif">

   image_tag('charts', :path => '/dynamic/')
   or
   image_tag('/dynamic/charts')
   # => <img src="/dynamic/charts">