[ActiveStorage] Possible to override storage preview for custom service?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[ActiveStorage] Possible to override storage preview for custom service?

Rikki Pitt
Hi folks,

I'm testing out Rails 5.2.0.rc1 and decided to dive in by creating an activestorage service for Dropbox.

A project I'm working on requires the upload of files to the Dropbox platform which I've successfully achieved.

Dropbox provides it's own preview images for a vast number of file types (e.g. PSD, PNG, JPG, Sketch etc).

I was wondering how I might go about extending/overriding the attachment previewer to use and return a URL from the Dropbox API if they have one?

Thanks for any advice you might have.

Best,
Rikki

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [ActiveStorage] Possible to override storage preview for custom service?

Rikki Pitt
Ah ha, this looks promising:

https://github.com/rails/rails/blob/master/activestorage/app/models/active_storage/preview.rb

On Tuesday, 13 March 2018 23:18:17 UTC, Rikki Pitt wrote:
Hi folks,

I'm testing out Rails 5.2.0.rc1 and decided to dive in by creating an activestorage service for Dropbox.

A project I'm working on requires the upload of files to the Dropbox platform which I've successfully achieved.

Dropbox provides it's own preview images for a vast number of file types (e.g. PSD, PNG, JPG, Sketch etc).

I was wondering how I might go about extending/overriding the attachment previewer to use and return a URL from the Dropbox API if they have one?

Thanks for any advice you might have.

Best,
Rikki

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.