paperclip

Wrong url with migrating paperclip to carrierwave

做~自己de王妃 提交于 2019-12-13 07:42:32
问题 When migrating paperclip to carrierwave, I followed the docs https://github.com/carrierwaveuploader/carrierwave#migrating-from-paperclip So I added paperclip compatibility include CarrierWave::Compatibility::Paperclip and I mounted the uploader mount_uploader :image, ImageUploader I also renamed the column name with following migration rename_column :picture, :image_file_name, :image (and I migrated this migration) But on the website, the url points to /uploads/picture/image/... while in fact

infinite loop (?) in active admin

我是研究僧i 提交于 2019-12-13 07:35:59
问题 I use Rails 3.0.7 and in some cases WebBrick enters an infinite loop increasing CPU and memory usage. To break it, I need kill -9 . It happened when I tried to use active_scaffold and the bug occurs when I use ActiveAdmin. What is strange, when I use a default fields in ActiveAdmin, its OK, but when I try to show photo (from paper_clip), it hangs. There is a code for column: column "Photo" do user.photo end I tried to insert debugger before a line user.photo , and I noticed that this loop

Rails 3 & Paperclip - Can I store images both on S3 & locally?

橙三吉。 提交于 2019-12-13 06:12:14
问题 We have a situation where we would like to start hosting images on Amazon's S3 service, however we don't want to upload all of our existing images to S3, instead we want to serve these "legacy" images from where they are hosted at the moment & going forward upload all new images to S3 and obviously serve those from S3. Does anyone know if this is possible using either PaperClip or CarrierWave? Thanks! 回答1: Here how you do this if you don't have a any version create a version called :s3

PaperclipOpenURI::HTTPError (403 Forbidden) with Amazon S3 Storage

蹲街弑〆低调 提交于 2019-12-13 05:48:39
问题 I have images stored in S3 with Paperclip and this error is intermittenly showing up. I had it resolved a few weeks ago by upgrading to ruby 2.1.5, but it's back now. Here's my controller code: def download extension = File.extname(@gallery_photo.image_file_name) send_data open("#{@gallery_photo.image.expiring_url(10, :original)}").read, filename: "original_#{@gallery_photo.id}#{extension}", type: @gallery_photo.image_content_type end Here's the error: OpenURI::HTTPError (403 Forbidden):

Get “nil” after uploading PDF/Worddocs to application Rails

旧街凉风 提交于 2019-12-13 04:58:13
问题 So, I am building an application where users can create a Pin and upload pictures and PDF/Word.docs to the Pin . It seems like I have done everything to enable those options; Created methods in the Pins model: class Pin < ActiveRecord::Base belongs_to :user has_attached_file :image, :styles => { :medium => "300x300>", :thumb => "100x100>" } validates_attachment :image, content_type: { content_type: ["image/jpg", "image/jpeg", "image/png", "image/gif"] } validates :image, presence: true has

Image seems to be added to bucket, can't view it on my app

一个人想着一个人 提交于 2019-12-13 04:55:19
问题 I just implemented paperclip in to my rails app that's hosted on heroku. The app seemingly connects and uploads the image to s3. Here are some examples of the logs when I submit the form on the app: 2013-06-01T17:52:45.112448+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "authenticity_token"=>"2/vRFLrAnBnokNwohVfMhG74d3HN0/GTwype2jGJm9w=", "illustration"=>{"name"=>"Test", "illustrator"=>"Test", "image"=>#<ActionDispatch::Http::UploadedFile:0x000000050d9a58 @original_filename="DEISIGN_Cover

Unpermitted parameters on multiple paperclip file uploads Rails4

放肆的年华 提交于 2019-12-13 04:43:47
问题 I've got a ruby 2.0.0 and rails 4.0.0 app that has a 'Guitar' and 'Photos' model. I've used paperclip to upload a single file in Rails3, but am new to uploading multiple files in Rails 4. I created the second model to hold said photos, and read up on strong parameters, etc. I'm getting an error when attempting to add 3 photos to a guitar. In the logs: "Unpermitted parameters: photos_attributes". I've tried adding photos_attributes to the whitelist and no joy. I'm pulling my hair out here -

ruby on rails - paperclip - nohandleerror - no handler found for

前提是你 提交于 2019-12-13 04:39:38
问题 I have a application that I use for posting stuff. I want a user to be able to write feedback to me and want them to be able to upload a screenshot as well. I have written a model, controller and stuff by myself. <div id="feedback-message" class="feedback-message" style="color: green;">Feedback sent</div> <span class="label label-info">Name</span><%= text_field_tag :name, "", class: 'form-control' %> <span class="label label-info">Topic</span> <select name="topic" id="topic" class="form

Paperclip custom processor not changing image type

半城伤御伤魂 提交于 2019-12-13 04:22:12
问题 I'm having a few problems with a paperclip custom processor. At the command line this line : $ convert cats.jpg -thumbnail 300x400 -bordercolor white -background black +polaroid cats.png Successfully converts this : https://dl.dropboxusercontent.com/u/4233433/cats.jpg Into this : https://dl.dropboxusercontent.com/u/4233433/cats.png i.e a JPEG converted into a PNG with a transparent background. Which is exactly what I am trying to achieve. However when I attempt to do this within Rails (4.0.1)

MiniMagick not working in production

妖精的绣舞 提交于 2019-12-13 04:19:34
问题 I am using MiniMagick gem to crop images and then saving them with mongoid paperclip. Everything seems to be working perfectly in development but in production I am getting the error "ActionView::Template::Error (uninitialized constant Model Name ::MiniMagick)". these are the lines giving the error inside the model: def profile_geometry img = MiniMagick::Image.open(avatar.path) @geometry = {:width => img[:width], :height => img[:height] } end Any help would be hugely appreciated. EDIT: