def dynamic_image_tag(record_or_array, options = {})
      record = extract_dynamic_image_record(record_or_array)
      options = { alt: filename_to_alt(record.filename) }.merge(options)

      size = fit_size!(record_or_array, options)
      url_options = options.extract!(*allowed_dynamic_image_url_options)
      html_options = { size: size }.merge(options)

      image_tag(dynamic_image_path_with_size(record_or_array,
                                             size,
                                             url_options),
                html_options)
    end
def dynamic_image_tag(record_or_array, options = {})
      record = extract_dynamic_image_record(record_or_array)
      options = { alt: filename_to_alt(record.filename) }.merge(options)

      size = fit_size!(record_or_array, options)
      url_options = options.extract!(*allowed_dynamic_image_url_options)
      html_options = { size: size }.merge(options)

      image_tag(dynamic_image_path_with_size(record_or_array,
                                             size,
                                             url_options),
                html_options)
    end
Returns an HTML image tag for the record. If no size is given, it will
 render at the original size.

 ==== Options
 * <tt>:alt</tt>: If no alt text is given, it will default to the
   filename of the uploaded image.

 See +dynamic_image_url+ for info on how to size and cropping. Options
 supported by +polymorphic_url+ will be passed to the router. Any other
 options will be added as HTML attributes.

 ==== Examples

   image = Image.find(params[:id])
   dynamic_image_tag(image)
   # => <img alt="My file" height="200" src="..." width="320" />
   dynamic_image_tag(image, size: "100x100", alt="Avatar")
   # => <img alt="Avatar" height="62" src="..." width="100" />