carrierwave

Override Rails Uploader to seed database

余生颓废 提交于 2019-12-29 08:02:15
问题 I have a CarrierWave rails uploader. I want to seed the database with fake users so I'm trying to add the images in with the same seed file. The images are in a common storage, so if I can just get the avatar strings in the database they'll work. When it saves the users though the image's aren't sticking. # db/seeds.rb user1 = User.create :email => "test1@test.com", :password => "testing", :name => "Bob Dylan", :avatar => "v1357014344/bdylan.jpg" user1.save # IRB User.first => #<User id: 1,

Showing images with carrierwave in rails 3.1 in a private store folder

狂风中的少年 提交于 2019-12-29 03:50:24
问题 I have a rails 3.1 app and I am adding carrierwave to store images. But I want to store those images outside the public folde,r because they should only be accessible when users are loaded in the app. So I changed the store_dir in carrerwave with the initializer file: CarrierWave.configure do |config| config.root = Rails.root end And my carrierwave uploader goes like this: class ImageUploader < CarrierWave::Uploader::Base ... def store_dir "imagenes_expedientes/#{model.class.to_s.underscore}/

exif image rotation issue using carrierwave and rmagick to upload to s3

↘锁芯ラ 提交于 2019-12-28 01:56:13
问题 I've got a photo upload feature in my rails app. The app uploads direct to s3 through carrierwave via rmagick and fog. The issue I am having is when a photo is uploaded via mobile through the "take a photo option" in portrait (note this is with iphone but I believe android has the same issue). Once uploaded the image appears fine on mobile, however when viewed on desktop the image appears rotated 90 degrees. Through my research it looks to be an issue with exif. This stackoverflow responder

exif image rotation issue using carrierwave and rmagick to upload to s3

匆匆过客 提交于 2019-12-28 01:56:03
问题 I've got a photo upload feature in my rails app. The app uploads direct to s3 through carrierwave via rmagick and fog. The issue I am having is when a photo is uploaded via mobile through the "take a photo option" in portrait (note this is with iphone but I believe android has the same issue). Once uploaded the image appears fine on mobile, however when viewed on desktop the image appears rotated 90 degrees. Through my research it looks to be an issue with exif. This stackoverflow responder

Rails and carrierwave uploading multiple images fails

痞子三分冷 提交于 2019-12-25 08:34:56
问题 Hello I have a form where I could write some articles, with a title, a content, a main_image, they all come from the same model progress In this same form I have another field from another model progress_attachment I use it to upload multiple images. ( I used carrierwave, and SSR solution as exemple) It works for title date content main image ! But the field with multiple file upload ony allows one image... it should accept multiple... What's wrong? So here is my form: = simple_form_for(

background images with carreirwave

╄→гoц情女王★ 提交于 2019-12-25 07:43:32
问题 I'm having trouble getting images I'm uploading using carrierwave to show in the blog I'm working on. Here's the view code: <div class="entry-header"> <div class="entry-image" style="background: image-url(<%= image_tag @blog.image_url.to_s %>)"> </div> <h1 class="entry-title"><%= @blog.title %></h1> </div> Currently it's displaying )"> where the image and title should be. I'm able to make that disappear by removing the = in the image tag, but that also doesn't solve the problem. Here's the

How do I process attachements programatically, from the model, without using forms?

徘徊边缘 提交于 2019-12-25 06:59:00
问题 I have a LineItem class that has an images column. It belongs to an Order class. When a line_item is saved, the images column is a list of comma delimited image urls. I want is to create a collage from the urls and save it as an attachment of the line_item instance. I'm not sure where to start, though. Any idea what my work flow should look like? Should I even use CarrierWave? Where should the image processing happen? In the LineItem model or the uploader file provided by CarrierWave? 来源:

Thinking-Sphinx not returning any results in console or via web app

試著忘記壹切 提交于 2019-12-25 05:18:11
问题 Similar to these: sphinx-not-indexing, thinking-sphinx returning empty results in console, similar here The problem description is this: I can't get any results with any parameters from Sphinx. I have a hdd scaffold, and when I try and perform a search in rails console with sphinx I get [], and that's even when I know that there are items in the database. If I do Hdd.search() I should get the same as Hdd.all, but instead I get []. I saw a post about doing Hdd.search().to_a, but that doesn't

Image displaying sideways

大城市里の小女人 提交于 2019-12-25 04:49:19
问题 I am using CarrierWave to upload an image. The image uploads fine. But any vertical image (only vertical images) displays sideways. How can I fix this? <div class="row"> <div class="profile_picture"> <%= image_tag @user.attachment.url %> </div> </div> the image tag turns into: <img src="/uploads/user/attachment/23/CIMG6610.JPG" alt="Cimg6610"> CSS: .profile_picture { max-width: 100%; img { max-width: 100%; } } if I look at the upload directly in the browser "localhost:3000/uploads/user

How to save dynamic number of images using carrierwave

别说谁变了你拦得住时间么 提交于 2019-12-25 03:59:20
问题 I'm using gem Carrierwave with fog to upload my images to AWS S3 . Right now, I have static memories like this. class CreateImagePosts < ActiveRecord::Migration def change create_table :image_posts do |t| t.string :img1 t.string :img2 t.string :img3 t.string :img4 t.string :img5 t.string :img6 t.string :img7 t.string :img8 t.timestamps null: false end end end But I want to make it possible to upload dynamic numbers of images not like present setting(limited in number of images). My model