Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process completion notification #64

Open
mhuggins opened this issue Apr 11, 2012 · 2 comments
Open

Process completion notification #64

mhuggins opened this issue Apr 11, 2012 · 2 comments

Comments

@mhuggins
Copy link

This should be tagged as a feature request, but there doesn't appear to be a list of tags when opening an issue for delayed_paperclip.

It would be nice to have a way to know when the image is finished processing. This would allow websites, for example, to render a placeholder loading spinner after an image is submitted, allowing the spinner to be replaced by the true image via AJAX when it is done processing and available for display.

@cristianbica
Copy link

You have 2 options here:

  1. You can define an boolena attribute "#{attachment_name}_processing" on your model which will be updated when the post process will finish. See the code https://github.com/jstorimer/delayed_paperclip/blob/master/lib/delayed_paperclip/attachment.rb#L52.
  2. You can use the paperclip's callbacks (before_post_process and after_post_process). At https://github.com/thoughtbot/paperclip search for events. I used those events a while ago and I remember that I run into some troubles when trying to change the model data with callbacks in the post_process callback

@jrgifford
Copy link

@cristianbica is correct on that from what I'm seeing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants