Sha256: 9adcd00d0a44ed44877a27261767ba52aef374dbdf779a71c9bc89885177e149

Contents?: true

Size: 562 Bytes

Versions: 1

Compression:

Stored size: 562 Bytes

Contents

include ActionView::Helpers::AssetTagHelper

module Uploadcare
  module Rails
    class File < Uploadcare::Api::File

      # override default to string method
      # instead of string representation of object it will return simple cdn url of a file
      def to_s
        cdn_url
      end

      # construct image tag for file
      def image with_operations=true, options={}
        if with_operations
          url = cdn_url_with_operations
        else
          url = cdn_url
        end
        
        image_tag url, options
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
uploadcare-rails-1.0.0.rc4 lib/uploadcare/rails/file.rb