I upload an image via jquery_file_upload (Railscast episode # 383) The upload works fine and I get the url in the callback function
The problem is this: I want to create some thumbnails after uploading directly to s3
for this I assume:
- Server must read image from s3
- Server needs to create thumbnails
- The server must store thumbnails directly in s3
- The server should receive a callback and display the thumbnails accordingly.
- The server must save the field created by the thumbnails.
Now, after completing the image, to load the image controller callback:
def create
And the model:
class Image < ActiveRecord::Base attr_accessible :image_thumb, :user_id, :width ,:album_type_id after_save :enqueue_image mount_uploader :image_thumb, ImageUploader def enqueue_image #checking if i have the original image if self.image_source present? #what to do here? #how can i call the carrierwave function to create the thumbnails? #how to send the thumbnails directly to s3 with callback name? end end end
source share