Closed puneetpandey closed 6 years ago
same issue with active admin jcrop and cloudinary. any answers on this?
Can you please post the version of gems like carrierwave, active admin and Rails? I'm really busy this week but I'll take a look in the weekend ok?
Cheers for the reply and for making time this weekend, really appreciate it. Version of gems below:
carrierwave (1.0.0)
activeadmin (1.0.0)
rails (5.0.2)
Great I'll let you know @bctoh
Any luck @Ricardonacif?
@bctoh looking at it now
@bctoh I just tested it using the gem versions you said. All good on my end. I did a demo repo with rails 5 so you can see if you're doing it right: https://github.com/Ricardonacif/active-admin-jcrop-rails-5-demo
Also, I recorded a video to highlight some important code parts: https://www.youtube.com/watch?v=zlnbAivTqDM&feature=youtu.be
Let me know if it worked for you.
@bctoh @puneetpandey do you override filename method in the uploader file?
@Ricardonacif thank you so much for your time. am able to make it work when editing a project model but the crop function doesn't appear when creating a new project model so when I upload an image for the first time, I'm unable to crop it there. Not sure if you experience the same thing?
@valdemarua managed to get it to crop eventually. now it's just a UX problem. if it doesn't work for some reason, I'll explore your suggestion 🍻
Hi, I am using carrierwave with s3 and trying to crop image but image never gets cropped. Below is my code:
jcropable form do |f| f.semantic_errors *f.object.errors.keys f.inputs 'Group' do f.input :name f.input :logo_url, as: :jcropable, hint: image_tag(f.object.logo_url.url(:thumb)) end f.actions end
model group.rbmount_uploader :logo_url, ActiveAdminLogoUploader
and inside active_admin_logo_uploader.rb ` class ActiveAdminLogoUploader < CarrierWave::Uploader::Base
include CarrierWave::MiniMagick
include CarrierWave::RMagick include ActiveAdminJcrop::AssetEngine::CarrierWave
if Rails.env.test? storage :file else storage :fog
storage :file
end
def store_dir "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" end
version :thumb do process :active_admin_crop process resize_to_fill: [256, 144] end end ` can you help?