carrierwave

CarrierWaveDirect Without Processing

。_饼干妹妹 提交于 2019-12-12 06:56:27
问题 I have a document model that consists of PDF files. Because I don't need to manipulate the PDFs in any way, I'm attempting to use CarrierWaveDirect without its processing step, which I believe is downloading and re-uploading the files. My uploader looks like this: class DocumentUploader < CarrierWave::Uploader::Base include CarrierWave::RMagick include CarrierWave::MimeTypes include CarrierWaveDirect::Uploader def will_include_content_type true end default_content_type 'application/pdf'

Rails Carrierwave and Simple Form

梦想与她 提交于 2019-12-12 06:19:51
问题 I have a rails 4 app that I use with simple form and carrierwave. In my profile view, I have a form that includes a request for users to nominate their university, as follows: <%= f.collection_select :university, University.all, :id, :name %> In my university model, I create universities and add their associated logos: { :class => 'question-project' }, placeholder: 'Your uni name', :input_html => {:style=> 'width: 650px', class: 'response-project'} %> <%= f.label :'Your university logo',

“Access Denied” - User's Permissions to S3 Bucket

守給你的承諾、 提交于 2019-12-12 05:13:14
问题 I send out an automated email for orders, and am now trying to have a link to download the a PDF receipt. User's are getting an error in the browser when trying to download saying "This XML file does not appear to have any style information associated with it. The document tree is shown below." I've gone into the bucket and run "Make Public" on the receipt bucket, still no luck. File structure is: app-name/uploads/order/receipt What do I need to do to allow permissions for User's to be able

AWS S3 403 Forbidden Error on newly created IAM inline policy for a new IAM user

血红的双手。 提交于 2019-12-12 05:08:24
问题 I have a brand new IAM user that I want to give upload & read access to my newly created bucket - myapp . This is the policy I am using for my user now: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:GetBucketLocation", "s3:ListAllMyBuckets" ], "Resource": "arn:aws:s3:::*" }, { "Effect": "Allow", "Action": [ "s3:ListBucket" ], "Resource": [ "arn:aws:s3:::myapp" ] }, { "Effect": "Allow", "Action": [ "s3:PutObject", "s3:GetObject", "s3:DeleteObject" ], "Resource"

Ruby on Rails: apply drop shadow with Carrierwave

流过昼夜 提交于 2019-12-12 04:48:48
问题 How do I apply a drop shadow to my images saved with carrierwave? I can't find any examples on how to do this. Update: Example for adding a shadow to images with CSS. You can remove the padding and margin if you don't like the white 1px border around the image. It looks nice though... .dropSmallShadow { box-shadow: 0 1px 5px rgba(0, 0, 0, 0.255); margin-left: 1px; padding: 1px; } Best regards Asbjørn Morell 回答1: My recommendation is to not add the border/dropshadow in the image (since you may

Rails nested attributes not saving using carrierwave

浪子不回头ぞ 提交于 2019-12-12 04:45:31
问题 I can get the gallery attributes to insert as evident by server log below but picture attributes will not insert as well. Server response Started POST "/galleries" for 127.0.0.1 at 2017-05-13 18:19:23 +1000 Processing by GalleriesController#create as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"LACaMz44B9mn/psLYjzs8qrwo9mr0l2OEIPg+VmCn9CdbGhBh9rDUJ6FE0EOwKCj7aZVjbM4+t0YoaFIRX7IEA==", "gallery"=>{"name"=>"Hello", "cover"=>"123456", "picture"=>{"picture"=>#<ActionDispatch::Http:

Image invalid on facebook/twitter user image uploading to S3

元气小坏坏 提交于 2019-12-12 04:33:16
问题 I'm trying to upload to amazon s3 an existing image on facebook or twitter from an user that has just signed up in my application, but some validation don't let me save the user object, throws: Image is invalid. I thought that was for my extension_white_list but I removed it and it's keeping saying Image is invalid. This it's not an error, it's just a message from a validation on carrierwave I think, even if the image url string is correct. AvatarUploader # encoding: utf-8 class

Uploading files to Linode using CarrierWave

雨燕双飞 提交于 2019-12-12 04:25:36
问题 My app is hosted on Heroku and I am wondering if its possible to upload a file not to the public/ folder on Heroku but directly to - say - Linode My app uses both Heroku and Linode. The two talk to each other via web-service requests. But generally speaking, I try to store any generated/uploaded file on Linode only - and nothing on Heroku Now I have a situation where I want to allow users to upload files. The final destination would be Linode. But currently, I am having to go from Client PC -

Rails display related posts by tags with images from carrierwave

為{幸葍}努か 提交于 2019-12-12 04:07:49
问题 postI'm trying to retrieve related posts by tags by showing the attached image per related post, uploaded by using the carrierwave gem Tags were written from scratch but similar to acts-as-taggable-on gem . Below solution picked from Rails count article per tag and related article by tag displays the related posts by title. <% @posts.each do |post| %> <% post.tags.each do |tag| %> RELATED POSTS: <% tag.posts.each do |related_post| %> <%= link_to related_post.title + " , ", post %> <% end %> <

public_id doesn't match between cloudinary and carrierwave

若如初见. 提交于 2019-12-12 03:18:17
问题 I'm using CarrierWave and Cloudinary to upload multiple pictures to my blogposts. I upload them from my browser. This happens with the use of a file field in the post form. <%=file_field_tag "images[]", type: :file, multiple: true %> When the form is being submitted, a picture instance is created for each one of the images and the image is being uploaded to Cloudinary. def create @post = Post.new(post_params) if @post.save if params[:images] params[:images].each do |image| @post.pictures