Tag: paperclip

Paper clip image showing up in wrong place

Hey i have a rails app that i am uploading images with paperclip…. So i have a comic_review scaffold that i upload images of comic covers and i also have a news scaffold where i post news and images….. When i edit news/1/edit and upload a picture the comics_review/1 picture becomes the same as the […]

wrong number of arguments (1 for 0) error after trying to use paperclip gem in Ruby on Rails

Updated with additional info I can’t figure out how to solve this issue. I tried updating the cocaine gem, restarting the server and some other methods that were described in other threads, but none of them worked. Here’s the error and the full trace below: ArgumentError in MicropostsController#create wrong number of arguments (1 for 0) […]

Paperclip style not respected

I have a Picture model, which has attached file picture, using Paperclip. class Picture < ActiveRecord::Base […] has_attached_file :photography, styles: { thumb: ‘115x’, gallery: ‘560×560’ } […] end File corresponding to thumb style is perfect but file corresponding to gallery style is always 560px width. I want to obtain a file with every sides of […]

Undefined method `validates_attachment_content_type' in Rails model class

Using Rails 2.3.* (legacy project, just adding some features) and I’m getting an error with the paperclip plugin. I’m not sure why it is telling me the method is undefined. Paperclip 2.4.5 is installed when I check my gems using gem list. The error is: undefined method `validates_attachment_content_type’ for #<Class:0x107d4e1c8> Extracted source (around line #122): […]

Undefined paperclip method

I am getting a method is undefined error in my Rails project. This method is used by the plugin paperclip. Can anyone tell me what I’m doing wrong? Here is the beginning of my picture class: require “paperclip” class Picture < ActiveRecord::Base validates_attachment_content_type :photo, :content_type => [‘image/jpeg’, ‘image/png’, ‘image/pjpeg’, ‘image/gif’,’image/bmp’] validates_attachment_presence :photo, :message => ‘is […]

Paperclip-av-transcoder not generating thumbnails in rails app

I am using paperclip-ac-transcoder gem for uploading videos in my rails app. Now, the videos are being successfully saved at the application path, but it’s not generating the thumbnails for it. Moreover, the video_tag is not working to display the video also. Below is my code :- has_attached_file :movie, :url => “:assets_host/system/:class/:attachment/:id/:style/:filename”, :path => “:rails_root/public/system/:class/:attachment/:id/:style/:filename”, […]

Paperclip gem “not a git repository”

when I run bundle install after adding gem “paperclip”, :git => “git://github.com/thoughtbot/paperclip.git” to my Gemfile, I get the following error: S-406c8f0a8159:etsydemo vivian.zhang$ bundle install Updating git://github.com/thoughtbot/paperclip.git fatal: Not a git repository (or any of the parent directories): .git Retrying git fetch –force –quiet –tags ‘git://github.com/thoughtbot/paperclip.git’ “refs/heads/:refs/heads/” due to error (2/3): Bundler::Source::Git::GitCommandError Git error: command git […]

Trying to add the Paperclip gem to rails project

I’m following a video tutorial to set the Paperclip gem up on my rails project. So the steps I’ve taken so far.. Installed ImageMagick on Terminal – brew install imagemagick Installed the Paperclip gem – gem “paperclip“, “~> 4.2” Added the following to my house.rb model file: has_attached_file :image, styles: { large: “600×600”, medium: “300×300”, […]

Rails One-To-Many Nested Form. No Image displayed in browser when using show action controller? (Paperclip Gem used)

I’m trying to create a posting form to post a url & image. The nested form submits without an error but I can’t display the subsequent image of that form in the browser. I have used the paperclip gem for the image upload. Post Model class Post < ActiveRecord::Base has_many :urls has_many :photos accepts_nested_attributes_for :urls, […]

How to pass image url values from option select to form action in ruby on rails

I want to save images from a url via a form that populates a “Select” field with a number of options. When the form is submitted, the selected image should be saved with the Paperclip gem. Here is the html select code block: <select id=”story_medium” name=”story[medium]”> <option data-img-src=”http://www.somedomain.com/image0.jpg” value=”0″>http://www.somedomain.com/image0.jpg</option> <option data-img-src=”http://www.somedomain.com/image1.jpg” value=”1″>http://www.somedomain.com/image1.jpg</option> <option data-img-src=”http://www.somedomain.com/image2.jpg” value=”2″>http://www.somedomain.com/image2.jpg</option> […]

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