Tag: paperclip

Paperclip dynamic styles based on polymorphic parent class doesn't work (Rails 4.2.5, Paperclip 4.3.1)

Basically I have an Image model which polymorphically belongs to imageable which are by far List and Item. Since an image will have its own attribute and relationship, I don’t want to treat images like attributes of the List and Item and mess it up. So I create the Image model. What I want to […]

Upload image post request over http to other application using Paperclip

I am able to upload image attachements using paperclip to my application. But I would like to send the image to another application via faraday connection. Other attributes are successfully sent but not the attachment image. I am not sure what I should do to achieve this.

Errors while using paperclip in rails app

At the moment I try to replace attachment_fu fileuploading plugin with paperclip. But there are some errors while uploading: My controller looks like this: def create add_breadcrumb ‘breadcrumb.upload_file’, {:action => :new} puts “BLUBBBBBBBBBBBBBBBBBBBBBBBBBBB” puts params[:upload] @upload = Upload.create(params[:upload]) @upload.lecturer_id = current_user.id if @upload.save flash[:notice] = I18n.t(“flash.saved”) redirect_to :action => :index else render :action => :new […]

Open a paperclip attached word doc in Ruby/rails

I have a rails app with file attachments using paperclip. Images and pdfs work fine in that if I click on the linked attachment, the image or pdf opens. If I right click, I can do a save-as. However, with Office files such as word.docx, I can only download the file. If I go do […]

Can you identify the current dimensions of an image with Paperclip?

I just updated the dimensions of an image thumbnail, and have been working on updating 28,000 photo objects. Unfortunately, this kind of process takes many processes over a long time to accomplish. In this process, some get rejected, and some processes get canceled. Is there a way to identify whether an image thumbnail has the […]

Does paperclip require all 4 columns (_file_name, _content_type,etc)?

I am wondering if Paperclip does require all four columns in database as: add_column :users, :avatar_file_name, :string add_column :users, :avatar_content_type, :string add_column :users, :avatar_file_size, :integer add_column :users, :avatar_updated_at, :datetime Can I just add the avatar_file_name? And not add the other 3 columns? It is because I wont to use paperclip instead of the filecolumn gem. […]

Ruby/Paperclip: How to get missing.png to work?

I am creating user avatars. I am having trouble getting the “missing.png” to show up. For users who decided not to upload a profile picture, I have created a default image to be displayed. Below is what I got so far. Please show me what I am doing wrong. user.rb has_attached_file :avatar, styles: { large: […]

Paperclip combined with Imagemagick saves images but doesn't display them on the site

I am using paperclip and Imagemagick to add images to a website. I have a form on the site for users to upload images. When I upload an image, it doesn’t give any errors. When I check the rails console, the image is saved with the right size and all that. When I check the […]

Videos not uploading with Paperclip Gem – ffmpeg in Rails

I’m able to upload my images however, when I try to upload videos it posts as a black screen with a play button that does not work. I’m not sure where I went wrong. Do I need a video player in order for this to work? This may be an easy solution however, I’m new […]

Access Paperclip image before it's uploaded to S3

My Rails app uploads images to S3 with Paperclip. I want to “intercept” the image before it is sent to S3, convert it to base64, and send it to a third-party API. How can I access the image before it gets uploaded by Paperclip to S3? This would be quicker than reading the file from […]

Ruby is the best programming language in the world - Ruby on Rails.