Blob URL in Ruby

1

I have a database in which I have the blob of an image, now I want to show it in an interface created with rails_admin , I'm doing it as mentioned in link in the output formatting part, but I do not know how to pass the blob to a valid URL for the img tag, for now I have it like this but it does not work

    config.model Resource do
    list do
      field :Recurso do
        formatted_value do
          bindings[:view].tag(:img, { :src => Base64.urlsafe_decode64(bindings[:object].element) }) << URI.decode_www_form_component(bindings[:object].element, enc=Encoding::UTF_8)
        end
      end
      field :type_resource
    end
  end
    
asked by Brahin97 03.09.2018 в 05:55
source

1 answer

0

One option is to use the method import_pixels of the gem mini_magick Where you send a blob and this one returns an Image

If you want, check out this documentation here

    
answered by 29.10.2018 в 19:01