paperclip

How exactly DO you integrate ckeditor with Paperclip so it can upload image files?

╄→尐↘猪︶ㄣ 提交于 2019-12-31 09:04:12
问题 How do you get http://github.com/galetahub/rails-ckeditor working so you can upload image files? I don't think I'll use the s3 storage... any help would be appreciated. 回答1: Yes you can. I assume that you have paperclip already set up for S3. So you have only edit the picture.rb and attachement_file.rb in you model directory (app/model/ckeditor/) and replace these lines has_attached_file :data, :url => "/ckeditor_assets/attachments/:id/:filename", :path => ":rails_root/public/ckeditor_assets

How to use Rails and Paperclip to store photos on Google Cloud Storage?

和自甴很熟 提交于 2019-12-31 09:04:07
问题 Until now, I have been using Amazon S3 for storing users' files. All what has been needed to do here was: specify Amazon S3 credentials to the bucket add 'aws-sdk' gem to the Gemfile and in the model: has_attached_file :avatar, :styles => { :big => "100x100#", :thumb => "25x25#" }, :storage => :s3, :s3_credentials => "#{Rails.root}/config/s3.yml", :path => ":rails_root/public/users/:id/:style/:basename.:extension", :url => "/users/:id/:style/:basename.:extension" To set the Amazon S3 adapter.

Rails 3.1 + Paperclip + jQuery fileupload

ⅰ亾dé卋堺 提交于 2019-12-31 08:39:11
问题 I've been looking for a way to set up Ruby on Rails 3.1 with Paperclip and jQuery fileupload. Looking at a tutorial at jQuery fileupload page I got the system set up but I can't find a way to make paperclip process the uploaded file. Here's what I have (in short): # model has_attached_file :photo ... # view = form_for @user, :html => {:multipart => true} do |f| f.file_field :photo, :multiple => true f.submit # controller def create @user = User.new params[:user] if @user.save render :json =>

Paperclip: How to store a picture in a Rails console?

ぐ巨炮叔叔 提交于 2019-12-31 08:29:35
问题 I tried storing a local image in a rails console. Because I have many pictures in my local storage (I use crawler to download tons of pictures), I want to store them into a database, with the benefit of paperclip to do some image job, like thumbnail etc. If I use a webpage to save new pictures to database one by one, it will cost a lot of time. So I want to find a way in rails console (some code) that can batch save-picture-into-database. 回答1: To further clarify @andrea's answer:

Paperclip: How to store a picture in a Rails console?

邮差的信 提交于 2019-12-31 08:29:12
问题 I tried storing a local image in a rails console. Because I have many pictures in my local storage (I use crawler to download tons of pictures), I want to store them into a database, with the benefit of paperclip to do some image job, like thumbnail etc. If I use a webpage to save new pictures to database one by one, it will cost a lot of time. So I want to find a way in rails console (some code) that can batch save-picture-into-database. 回答1: To further clarify @andrea's answer:

paperclip gem validation error - 'filename' is not recognized by the 'identify' command

北城余情 提交于 2019-12-31 05:17:08
问题 I'm trying to get the paperclip gem to upload images on my production server (ubuntu 12.0.4, apache2, phusion passenger and rvm) and for each attachment I get three lots of this validation error: Img one /tmp/villa-0520121006-4333-hdo9wv.jpeg is not recognized by the 'identify' command. ImageMagick is installed properly, as is the libmagickwand-dev package, Rmagick and paperclip. And I've set the correct command_path to where identify and convert are located in my production.rb config file.

ImageMagick on Google Cloud

寵の児 提交于 2019-12-31 05:14:10
问题 I use ImageMagick on the Google Cloud Platform. I use rails and Google's App Engine Flexible Environment. So the problem is I want to upload an Image to process in more sizes. I use paperclip. The error is: Could not run the identify command. Please install ImageMagick. So my question is how I can solve this issue? Uploading a Image without processing works 100%. But the issue is the processing I think. So paperclip needs ImageMagick to process the images. The problem is I use App Engine

Rails Paperclip gem wrong number of arguments error

余生颓废 提交于 2019-12-31 02:56:29
问题 I'm working on my first RoR project and attempting to use the Paperclip gem, but I'm running into an error I can't seem to figure out: wrong number of arguments (1 for 0) app/controllers/events_controller.rb:43:in `create' Parameters: {"utf8"=>"✓", "authenticity_token"=>"OBYHA0M+TA93sNF3uqrJ/zvnnEyWJUREn4NcOl0ExfA=", "event"=>{"title"=>"", "image"=>#<ActionDispatch::Http::UploadedFile:0x007f803802b1f0 @original_filename="icon.png", @content_type="image/png", @headers="Content-Disposition:

Deploying on Heroku - Images disappears after upload

别说谁变了你拦得住时间么 提交于 2019-12-30 17:09:24
问题 I deployed an application on Heroku which I wrote on Ruby on Rails. It is a movie review app. I am able to upload images from my computer, to the web app online. Everything else works as per my expectations. The images disappear after a day. My requirement is to have the image continue to render. I am using Paperclip gem from rails. This only happens on the deployed version and not on localhost. 回答1: The default upload location on Heroku is into temporary storage. This is because you will get

Add paperclip url to json

你离开我真会死。 提交于 2019-12-30 14:24:33
问题 Normally in html we will use Model.field.url(:thumb) inside image tag, How to do it on json, especially with hash_secret. 回答1: In your model add the following to get the url (I believe this also works with hashing): def photo_url_thumb photo.url(:thumb) end And then you can output json like this: format.json { render :json => @model.photo_url_thumb } 回答2: In case of this being helpful to anyone, i find out a nice way to do this: class MyModel < ActiveRecord::Base has_attached_file :avatar,