paperclip

Errors when using paperclip plugin for rails in production. Image not being saved to server

谁说胖子不能爱 提交于 2019-12-02 08:59:47
问题 I am running rails 3 and paperclip 2.3.4. In development on OS X every thing runs great but production there are some issues that I can't quite figure out. If anyone have suggestions please let me know. I am uploading the file using flash BTW. Like I said local development works great. I checked the production log and it looks like the POST is happening just fine. Started POST "/addimage" for 10.0.136.119 at 2011-01-13 19:49:09 +0000 Processing by BowlsController#create as HTML Parameters: {

Rails 5 on heroku forgets files stored with paperclip and turbolinks: No route matches

邮差的信 提交于 2019-12-02 08:19:15
I have a blog with file up-/download via paperclip 5.1.0 and turbolinks 5.0.1. Upload without validation works fine now, but download is only working for a short period after upload. Afterwards an error (404) is displayed: The page you were looking for doesn't exist. You may have mistyped the address or the page may have moved. If you are the application owner check the logs for more information. This did not help: heroku rake db:migrate heroku restart I am on production with mysql DB on heroku. When I am not deploying via heroku: then the local copy works just fine with ruby version 2.2.4!

Rails 4 and paperclip - Stop the :original style file upload to copy it from an S3 remote directory

随声附和 提交于 2019-12-02 08:07:05
I use Paperclip 4.0.2 and in my app to upload pictures. So my Document model has an attached_file called attachment The attachment has few styles, say :medium, :thumb, :facebook In my model, I stop the styles processing, and I extracted it inside a background job. class Document < ActiveRecord::Base # stop paperclip styles generation before_post_process false end But the :original style file is still uploaded! I would like to know if it's possible to stop this behavior and copy the file inside the :original/filename.jpg from a remote directory My goal being to use a file that has been uploaded

Adding :multipart => true throws Undefined Method “name” error

百般思念 提交于 2019-12-02 05:57:08
问题 I'm drawing a blank on this one. Here's my problem: Short Version My image#create action is failing on the image.save call and throwing Undefined method "name" for nil:NilClass . The Image model includes a file upload via paperclip gem. The part that is throwing me: the error only occurs when I include :multipart => true on the submitting form When I take that out, the form works perfectly, except of course the image file doesn't get uploaded. See the stack trace below for details on where it

Copy a Paperclip image to a new record in Rails 4

做~自己de王妃 提交于 2019-12-02 03:31:34
问题 My site is for posting album reviews, which are called Pins. The pins model has the following attributes: :artist, :year, :title, :rank, :description, and :image The image uses Paperclip and is stored on Amazon S3 if that matters I am trying to allow a user to see a review that another user posted and click a link to more simply write their own review for that same album. So basically the link takes them to the Pin.new page and the form already has the :artist, :title, :image, and :year

Copy a Paperclip image to a new record in Rails 4

前提是你 提交于 2019-12-02 01:43:50
My site is for posting album reviews, which are called Pins. The pins model has the following attributes: :artist, :year, :title, :rank, :description, and :image The image uses Paperclip and is stored on Amazon S3 if that matters I am trying to allow a user to see a review that another user posted and click a link to more simply write their own review for that same album. So basically the link takes them to the Pin.new page and the form already has the :artist, :title, :image, and :year filled in. I figured out how to do it while bringing ALL of the attributes, including the :description and

Adding :multipart => true throws Undefined Method “name” error

不打扰是莪最后的温柔 提交于 2019-12-02 01:22:06
I'm drawing a blank on this one. Here's my problem: Short Version My image#create action is failing on the image.save call and throwing Undefined method "name" for nil:NilClass . The Image model includes a file upload via paperclip gem. The part that is throwing me: the error only occurs when I include :multipart => true on the submitting form When I take that out, the form works perfectly, except of course the image file doesn't get uploaded. See the stack trace below for details on where it fails. It looks like its hitting a nil value when trying to quote something for the INSERT statement,

405 Error when trying to POST a file in rails

亡梦爱人 提交于 2019-12-02 01:06:44
I am using paperclip gem to upload a file to the database. When I select the file I want to upload and go to create it, the next page should redirect_to root path. Instead, I get "Method Not Allowed" in my browser. I open Dev Tools and the console says: Failed to load resource: the server responded with a status of 405 (Method Not Allowed) My logs look like: Started POST "/assets" for ::1 at 2015-08-20 10:41:11 -0400 and remains hooked until I go back to another page. Here is my controller class AssetsController < ApplicationController # before_filter :authenticate_user! def index @assets =

Undefined method `has_attached_file' with paperclip 2.3.8 gem for Rails 2 using Ruby 1.8.7

こ雲淡風輕ζ 提交于 2019-12-02 01:02:14
问题 I am trying to use the paperclip plugin in my rails app to upload images for posts. I am using Rails 2.0.2 and ruby 1.8.7 on Ubuntu 10.04 os for project specific purposes. I am referring to the following tutorials for this :- http://railscasts.com/episodes/134-paperclip?view=comments http://jimneath.org/2008/04/17/paperclip-attaching-files-in-rails.html I did a git clone on the paperclip plugin via:- https://github.com/thoughtbot/paperclip , but the command like ruby script/generate paperclip

Uploadify + Paperclip + Rails nested association before_save

十年热恋 提交于 2019-12-02 00:29:29
I need to create a model application form where models can fill it and add pictures to it. I'm following this example with Uploadify, Paperclip and Rails 3 approach. https://github.com/websymphony/Rails3-Paperclip-Uploadify To the pictures, i have an polymorphic Attachment model and i would like to attach those ajax uploaded attachments to the yet unsaved model form and there's is where the tricky part cames. Users are not logged, so there's no "model_id" until is saved. Since i'm showing the user a small preview of the images that he uploaded in the form by ajax after each upload i need some