I got carrierwave and carrierwave-crop which are working just fine. Now I want the file upload to be executed via JS like this:
- User selects a photo to upload
- Form is sent and photo uploaded once selected
- The
crop
view gets rendered via JS - Cropping is submitted via JS
- Newly cropped photo appears
Is there anyway I can do this with carrierwave-crop? I already added remotipart for JS file upload. All I need now is the proper handling in the controller and js file. Just don't know how to start.
* EDIT *
I have managed everything except one thing. This is what happens: 1. User selects a photo which is uploaded via AJAX, file select box closes 2. The crop view is rendered via AJX into a newly created modal window which also appears.
However, the cropping stuff doesn't appear because, I would say, the cropping JS isn't executed.
- Tried to move the JS stuff into the response JS - modal window doesn't show anymore
- Tried to move the JS stuff into the view so it gets executed when loaded - modal window doesn't show anymore.
Anyone has an idea what I'm missing here?