carrierwave

Rails 4 strong parameters param not found error with carrierwave

ⅰ亾dé卋堺 提交于 2019-12-17 18:33:21
问题 I'm having trouble with carrierwave and rails 4 strong parameters. I have a very simple model with a carrier wave upload button. I'd like to show an error message if someone submits the upload form without choosing a file to upload. Right now, I get a param not found:photo error with this message: # Never trust parameters from the scary internet, only allow the white list through. def photo_params params.require(:photo).permit(:image) end This error is happening because Rails 4's strong

Best Ruby on Rails Architecture for Image Heavy App

醉酒当歌 提交于 2019-12-17 17:29:30
问题 I'm building an application that allows for large amounts of photo uploads at once, and wanted to know what the best setup would be to tackle this. This is what I am using so far: Jquery File Upload: allows users to drag and drop images CarrierWave: Processes images and resizes them with ImageMagick Amazon S3: CarrierWave uploads images to Amazon S3 through Fog Heroku: for hosting I'd like to allow users to be able to drag and drop a large amount of images onto a page, and then navigate to

Rails - WIndows 7 carrierwave, minimagick resize not working

回眸只為那壹抹淺笑 提交于 2019-12-14 04:12:34
问题 I tried to set up for uploading photos with my rails app. However, the carrierwave uploader does not resize the photos being uploaded. When I do not call the resize_to_fill function, the photos are uploaded perfectly. Any advice? When a photo is submitted with resize_to_fill, the error 'failed to be processed' is returned. How can i fix it? I guess I need to 'require' 'carrierwave/processing/mini_magick' for calling resize_to_fill, but i don't know where to put this file. gemfile "carrierwave

Carrierwave converting PDF to JPG (MiniMagick)

寵の児 提交于 2019-12-14 04:01:56
问题 I have a problem creating JPG thumbnails for PDF files. I'm using Carrierwave. Imagemagick is properly installed. There are no problems creating thumbnails of PNG, JPG or GIF files. Here is the code I use version :thumb, :if => :image? do storage :file begin process :convert => 'jpg' # this should do the trick but doesn't process :resize_to_fill => [160,160] process :quality => 95 process :set_content_type process :set_thumb_attr => true def full_filename (for_file = model.file.file) "#{model

Rails Admin - undefined method `' for using Carrierwave multiple upload

不羁的心 提交于 2019-12-14 03:59:23
问题 I can't edit some records in Rails Admin after do a multiple files upload using Carrierwave. I guess that did the correct config, when I upload the files everything goes well, but if I try edit after save the record that error happens: .log: 14:33:56 web.1 | Started POST "/admin/__better_errors/563c2613b62e459f/variables" for 127.0.0.1 at 2018-11-21 14:33:56 -0200 14:33:56 web.1 | Tag Load (0.6ms) SELECT "tags".* FROM "tags" INNER JOIN "projects_tags" ON "tags"."id" = "projects_tags"."tag_id"

Rails CarrierWave versions are not created for some reason

别说谁变了你拦得住时间么 提交于 2019-12-14 02:15:42
问题 I have the following file uploader class ItemImageUploader < CarrierWave::Uploader::Base include ::CarrierWave::Backgrounder::Delay include CarrierWave::MiniMagick include Sprockets::Helpers::RailsHelper include Sprockets::Helpers::IsolatedHelper def store_dir "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" end # Provide a default URL as a default if there hasn't been a file uploaded: def default_url asset_path("fallback/" + [version_name, "image.png"].compact.join('_'))

Rails Carrierwave Video Uploader

非 Y 不嫁゛ 提交于 2019-12-13 21:05:43
问题 Im using carrierwave with my Rails 4 app. I have two uploaders installed - one for avatar and one for video. I use both of them in my projects model. My project.rb file has: mount_uploader :hero_image, AvatarUploader mount_uploader :link_to_video_proposal, VideoUploader My project controller includes: params.require(:project).permit(:link_to_video_proposal) My project _form has: <%=f.file_field :link_to_video_proposal%> My project show page has: <%= video_tag @project.link_to_video_proposal

Errors are displayed twice in rails

こ雲淡風輕ζ 提交于 2019-12-13 17:00:51
问题 I am using carrierwave to upload the profile picture in user model. If the user tries to upload any file that is not an image, then an error must be raised. However the error is displayed twice on the screen. Please help code for user model class User < ActiveRecord::Base include CarrierWave::MiniMagick validates :email, :presence =>true, :uniqueness => {case_sensitive: false}, :format => { :with=> /([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]

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

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