paperclip

Rails file upload (paperclip) on edit

时光怂恿深爱的人放手 提交于 2019-12-30 03:47:08
问题 I made myself a simple rails blogging-type app where I use Paperclip to upload image files.I have everything working fine and dandy. I even have it hooked up to an S3 bucket, etc. Spiffy right? But I can't figure what to do when EDITING/UPDATING a post. As is stands now, all I have is this field on my form template: = f.file_field :image So, say on "post/5/edit" even if there's a previously attached image, the field displays "No file chosen". Even worse, there's no apparent way to clear out

paperclip custom :path and :url

你。 提交于 2019-12-30 03:14:55
问题 I have some problems trying to custom the :path and :url options for has_attached_file with paperclip: I have a polymorphic class named "Asset" that have : class Asset < ActiveRecord::Base belongs_to :file_owner, :polymorphic => true has_attached_file :picture, :styles => { ...}, :url => "/attachments/user_:user/dressing_:dressing/garment_:garment/category_:category/:basename_:style.:extension", :path => ":rails_root/public/attachments/user_:user/dressing_:dressing/garment_:garment/category_

paperclip error while reporcessing after rails 3 upgrade

佐手、 提交于 2019-12-29 05:35:50
问题 I have paperclip working uploading and saving different styles for images but when i go to crop the image using jcrop from railscasts tutorial it doesnt crop image. I get this error [paperclip] identify -format %wx%h '/var/folders/z+/z+KzOZBFE9irCpbMKKBGFk+++TI/-Tmp-/paperclip-reprocess20110118-19757-1wtrjaj-0[0]' 2>/dev/null [paperclip] convert '/var/folders/z+/z+KzOZBFE9irCpbMKKBGFk+++TI/-Tmp-/paperclip-reprocess20110118-19757-1wtrjaj-0[0]' -crop 28x32+13+15-resize "400x400>" '/var/folders

Paperclip::NotIdentifiedByImageMagickError in Spree::Admin::ImagesController#create

不羁的心 提交于 2019-12-28 06:52:31
问题 I am attempting to setup Spree for the first time. Everything was going well until I hit the image upload. I have installed Imageamgick using homebrew on Mac OSX Mountain Lion. Uploading any image gives me the following error. Paperclip::NotIdentifiedByImageMagickError in Spree::Admin::ImagesController#create Command :: identify -format %wx%h :file [paperclip] An error was received while processing: #<Paperclip::NotIdentifiedByImageMagickError: /var/folders/fq/9g_6hmg513g6137rb6sbghw00000gn/T

Multiple models and Paperclip

 ̄綄美尐妖づ 提交于 2019-12-25 18:35:22
问题 I was wondering if it is possible to have multiple models all using one central model for its images using paperclip.. So for example I would have a photo model which would use paperclip to store its urls etc In my case I have 2 models, portfolio and post, both of which have a form which allow you to upload images and other attributes to the model. So can both models have a has_many :photos, :dependent => :destroy accepts_nested_attributes_for :photos or would i need to create separate models

Rails Heroku Paperclip Files disapperad

丶灬走出姿态 提交于 2019-12-25 12:36:14
问题 I'm developing a webapp with Rails, Paperclip and Heroku but since my last commit were I just added Google Analytics the most of the uploaded images disappeared! That's my link: http://wo42.herokuapp.com/ I don't know why that happened oO 回答1: Heroku never used to let you write to their file-system although they have recently introduced something calld the ephemeral file-system - this article explains it. Best option is to use S3. 回答2: The actual issue here is that when you push to Heroku

Sample rails4 application with REST API which uses paperclip to upload to Amazon S3

心不动则不痛 提交于 2019-12-25 09:16:54
问题 Can someone share me a sample application , that has REST APIs to upload images to Amazon S3 . I've googled a lot , but most of them are not working as expected . A little help would be greatly appreciated . 回答1: For uploading images through API you can convert the images to base64 format in front end and send it to server. In, server you can convert the base64 data into the image and save it to S3 via paperclip . class User < ActiveRecord::Base before_save :decode_picture_data, :if =>

Heroku ArgumentError ( is not a recognized provider)

不问归期 提交于 2019-12-25 05:45:28
问题 I am trying to upload profile pictures to Google Cloud using Paperclip and Fog gems. so far this what I have In my Gemfile gem "paperclip", git: "git://github.com/thoughtbot/paperclip.git" gem 'fog' In my user model has_attached_file :avatar, styles: {:big => "200x200>", thumb: "50x50>"}, storage: :fog, fog_credentials: "#{Rails.root}/config/gce.yml", fog_directory: "google-bucket-name" validates_attachment_content_type :avatar, content_type: /\Aimage\/.*\Z/ When I run this locally, I am able

Can I use Paperclip for comments in rails and how?

旧城冷巷雨未停 提交于 2019-12-25 04:37:07
问题 I want users to be able to comment on a post with an image or gif which Paperclip supports very well. How can i achieve that? Can it work with acts_as_commentable? 回答1: You can use wysiwyg-rails it's easier 来源: https://stackoverflow.com/questions/36607432/can-i-use-paperclip-for-comments-in-rails-and-how

Where is my rails installation located? Where are the rails plugins?

与世无争的帅哥 提交于 2019-12-25 04:33:52
问题 I'm trying to delete a plugin I installed for rails (paperclip). But I actually don't have any idea where I can find my local rails installation directory. So where can I find rails and rails plugins in my local file system? I have OS X. Or how can I uninstall paperclip from the command line? Thx! 回答1: paperclip is a rails plugin, which means it is in [your rails app directory]/vendor/plugins/paperclip so if you delete that folder, paperclip is gone. 回答2: Under the directory vendor/plugins of