Questions tagged [paperclip]

Paperclip is a library for the Ruby on Rails framework which makes dealing with file attachments easier. In addition to dealing with standalone files, the library provides convenience methods for creating image thumbnails. Paperclip is now deprecated - the authors recommend using ActiveStorage (they have provided a migration guide)

Paperclip is now deprecated. The library authors recommend switching to ActiveStorage. They have provided a migration guide as well.

Paperclip is intended as an easy file attachment library for ActiveRecord. The intent behind it was to keep setup as easy as possible and to treat files as much like other attributes as possible.

For more information:

4288 questions
1
vote
1 answer

how to remove id after extension in paperclip?

how do remove id after ? in paperclip, I need only file_name.extension, when I copy image link I am getting: /images/company_informations/s200/logo.jpg?1313497842
Ignas
  • 315
  • 1
  • 8
  • 22
1
vote
0 answers

rails 3 saving default image while uploading using paperclip

i use paperclip to upload images to the server in rails 3. If the user didn't choose any file to upload i want to store a default image in the server i.e., storing a default image in different size like thumb, normal, feature... :default_url =>…
Arivarasan
  • 131
  • 1
  • 4
1
vote
3 answers

Not recognized by the 'identify' command error while using validates_each

Below is my validations for image content type which works fine. validates_attachment_size :icon, :less_than => MAX_SIZE.megabytes, :message => "Max size is 1 mb" validates_attachment_content_type :icon, :content_type => ['image/jpg','image/jpeg',…
ashisrai_
  • 6,438
  • 2
  • 26
  • 42
1
vote
1 answer

Paperclip routing error

After I register a user, the request goes through and says that the registration was successful, but instead of the resized image appearing, the file name is the only thing that appears. Here is my error message: Started GET…
conpill
  • 147
  • 1
  • 1
  • 12
1
vote
1 answer

paperclip destory attachment not deleted

I am facing an embarrassing issue with paperclip. When calling destroy method of the associated model. the database record is deleted , but not the attachment files. I have seen the rails server logs, and I see the log "Deleting attachments" only,…
enenkey
  • 1,261
  • 3
  • 16
  • 27
1
vote
0 answers

deleting old image record while updating paperclip polymorphic

I am using paperclip polymorphic plugins to manage attachments. I have a problem now that I cannot delete the old attachments while updating. Is there a way to achieve this or any way round to that I always gets the recent attachment.
ashisrai_
  • 6,438
  • 2
  • 26
  • 42
1
vote
1 answer

Rails 6, Paperclip, S3, s3_direct_upload @attachment.save not saving after the s3_direct_upload completes

I have re-written an application called FilterTrak from an older version of Rails v4.2 to Rails v6 and I have everything working now except one part of the picture upload. The app uses Paperclip, aws-sdk-v1, and s3_direct_upload. I previously had…
Scott Milella
  • 468
  • 5
  • 10
1
vote
0 answers

LoadError: cannot load such file -- azure

I was updated ruby and rails from 5.2 to 6.0.1 and after that, I was tried to run Rspec then get this error. LoadError: cannot load such file -- azure Also reported on GitHub here is the…
1
vote
2 answers

What is the best way to have image uploading and cropping in a rails app?

I want to upload an image to a model and then crop it. I tried using paperclip with jcrop, but I can not figure it out. Any other options out there?
Spencer Cooley
  • 8,471
  • 16
  • 48
  • 63
1
vote
1 answer

Rails: Rendering video uploaded by paperclip

I am using Rails 6.1 + Ruby 3 and trying to allow users to upload videos and then watch them in app. clip.rb class Clip < ApplicationRecord belongs_to :chapter has_attached_file :video, styles: { :medium => { :geometry =>…
beaconhill
  • 441
  • 6
  • 28
1
vote
0 answers

Error while testing assets : can't dup NilClass

I'm using rails 3.0.9 with ruby 1.9.2. I am doing a system that allow users to put items into different closets. One of the user's possibility is to copy an item of an other user into his own closet (please tell me if you don't understand, I'm not…
JennyR
  • 11
  • 2
1
vote
1 answer

paperclip url to return asset_host

i'm searching for a solution to get the absolute url with asset_host of a paperclip object. the url method only returns the relative url. so i tried this: Paperclip::Attachment.default_options.update({ :url =>…
Oliver
  • 801
  • 13
  • 26
1
vote
2 answers

Rails Paperclip add a image size when checkbox is checked

I have a model of attachments that belongs to the asset model. The asset model can have a main image, which will be scaled image that only exists if the main_image checkbox is checked. I want to add this size to paperclip, but I don't know how. …
Travis Pessetto
  • 3,260
  • 4
  • 27
  • 55
1
vote
0 answers

delayed_paperclip with sidekiq returning NoMethodError: undefined method `fetch' for nil:NilClass

I am using delayed_paperclip and I have tried it with the default ActiveJob and it works well. However, it runs synchronously so it will wait for the job to finish before response so I wanted to move the queue to sidekiq. But now that I have moved…
eibersji
  • 1,218
  • 4
  • 29
  • 52
1
vote
3 answers

Using Paperclip + heroku + s3 ... local uploads broken when pushed live

I am building a small website that has a fairly large amount of pictures > 100 for a small local group of people. If I upload files to s3 via paperclip on my local machine they work just fine, but when I push it to heroku those pics are then broken…
Msencenb
  • 5,675
  • 11
  • 52
  • 84