I used RailsCasts' Carrierwave tutorial to get my image to upload and display, and now I wanted to get the images to upload directly to S3 with CarrierWaveDirect, but "uninitialized constant ImageUploader::CarrierWaveDirect" this error shows. (I don't really know where the images were stored with just the CW, but I'm guessing inside the application)
After the Railscasts' version,
- I installed gem 'carrierwave_direct', and 'fog'
- I created a carrierwave.rb file inside the config/initializers (not sure if this is the right place or right file name because the readme in CarrierWave mentioned something about lib/carrierwave/storage/fog.rb)
- I changed the "storage:file" inside my image_uploader.rb to "include CarrierWaveDirect::Uploader"
- In the form view, I changed "form_for" to "direct_upload_form_for"
Do I need to change anything else? I also didn't really understand what "Make sure you are loading CarrierWave after loading your ORM, otherwise you'll need to require the relevant extension manually, e.g.: require 'carrierwave/orm/activerecord' " meant in the original CW readme.
I am just confused what I need to do because both the original CarrierWave and CW_direct readme's mention S3 uploading, and I am caught in between the two directions that both are giving...
Can anyone please help me understand what's wrong and why it says 'uninitialized constant ImageUploader::CarrierWaveDirect'? I also had an error saying something about unauthentic, and I was assuming it had something to do with Devise - is that because the image is being attached to the user generated by Devise and I need to configure something?