Search Results

Search found 15 results on 1 pages for 'carrierwave'.

Page 1/1 | 1 

  • Amazon access key showing in URL for Carrierwave and Fog

    - by kcurtin
    I just switched from storing my images uploaded via Carrierwave locally to using Amazon s3 via the fog gem in my Rails 3.1 app. While images are being added, when I click on an image in my application, the URL is providing my access key and a signature. Here is a sample URL (XXX replaced the string with the info): https://s3.amazonaws.com/bucketname/uploads/photo/image/2/IMG_4842.jpg?AWSAccessKeyId=XXX&Signature=XXX%3D&Expires=1332093418 This is happening in development (localhost:3000) and when I am using heroku for production. Here is my uploader: class ImageUploader < CarrierWave::Uploader::Base include CarrierWave::RMagick storage :fog def store_dir "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" end process :convert => :jpg process :resize_to_limit => [640, 640] version :thumb do process :convert => :jpg process :resize_to_fill => [280, 205] end version :avatar do process :convert => :jpg process :resize_to_fill => [120, 120] end end And my config/initializers/fog.rb : CarrierWave.configure do |config| config.fog_credentials = { :provider => 'AWS', :aws_access_key_id => 'XXX', :aws_secret_access_key => 'XXX', } config.fog_directory = 'bucketname' config.fog_public = false end Anyone know how to make sure this information isn't available?

    Read the article

  • How can I rename by CarrierWave file versions?

    - by AKWF
    Upon the uploading of an image in my application, 4 different sizes are created and saved using CarrierWaves version functionality. However, I am converting all of these versions to JPEG. The source file that is uploaded remains unchanged. So I can upload a TIFF file, and CarrierWave will create :large, :medium, :small, and :thumb versions. My problem is that these files all still end in .tif. Yet they are indeed JPEG files, as I've verified this with the file command. How can I write the filenames correctly for each version, and ensure that CarrierWave will report each version's name correctly?

    Read the article

  • undefined local variable or method `user', using CarrierWave for profile images

    - by Amar H-V
    I've been following Ryan Bates' Railscasts tutorial on CarrierWave, which you can find here Everything works fine, except for when I go to view my profile, it gives me this error: undefined local variable or method `user' I don't know why it is telling me this, as I am using Devise for my authentication, and that is the name of my model. Below are some of the files which may be useful: https://gist.github.com/amarh21/7439421 I am using Rails 4.0.1 and ruby 2.0.0

    Read the article

  • Carrierwave upload to a tmp dir before saving to database

    - by user827570
    I'm trying to build a visual editor where users can click an image they are presented with an image upload form once the upload is done I use ajax to return the image and insert it back into the page. But the above method inserts the image straight into the database but I want users to be able to visualize the image before the image is inserted into the database. So I was wondering if the image using carrierwave could be uploaded to a temp location, sent back to the user and then when the user saves the page the image is moved into the permanent location. Here's what I have so far. def edit_image @page = Page.find(1) @page.update_attributes(params[:page]) @page.save return :text => @page.file end But this is what I want to achieve def temp_image #uploads received image to a temp location #returns image to the user end And once the user clicks save def save #moves the file in the temp folder to the permanent location end Cheers

    Read the article

  • CarrierWave and nested forms saving empty image object if photo :title is included in form

    - by Wasabi Developer
    I'm after some advice in regards to handling nested form data and I would be ever so grateful for any insights. The trouble is I'm not 100% sure why I require the following code in my model accepts_nested_attributes_for :holiday_image, allow_destroy: true, :reject_if => lambda { |a| a[:title].blank? } If I don't understand why I require to tact on on my accepts_nested_attributes_for association: :reject_if => lambda { |a| a[:title].blank? } If I remove this :reject_if lambda, it will save a blank holiday photo object in the database. I presume because it takes the :title field from the form as an empty string? I guess my question is, am I doing this right or is there a better way of this this within nested forms if I want to extend my HolidayImage model to include more strings like description, notes? Sorry If I can't be more succinct. My simple holiday app. # holiday.rb class Holiday < ActiveRecord::Base has_many :holiday_image accepts_nested_attributes_for :holiday_image, allow_destroy: true, :reject_if => lambda { |a| a[:title].blank? } attr_accessible :name, :content, :holiday_image_attributes end I'm using CarrierWave for image uploads. # holiday_image.rb class HolidayImage < ActiveRecord::Base belongs_to :holiday attr_accessible :holiday_id, :image, :title mount_uploader :image, ImageUploader end Inside my _form partial there is a field_for block <h3>Photo gallery</h3> <%= f.fields_for :holiday_image do |holiday_image| %> <% if holiday_image.object.new_record? %> <%= holiday_image.label :title, "Image Title" %> <%= holiday_image.text_field :title %> <%= holiday_image.file_field :image %> <% else %> Title: <%= holiday_image.object.title %> <%= image_tag(holiday_image.object.image.url(:thumb)) %> Tick to delete: <%= holiday_image.check_box :_destroy %> <% end %> Thanks again for your patience.

    Read the article

  • How to give the First image in a gallery a different class than the rest of the images - Carrierwave

    - by ChrisBedoya
    I have a model called "Photo" that belongs to a model called "Shoe". I using Carrierwave to upload multiple images. index.html.erb <% shoes.each do |shoe| %> <div class="shoe"> <div class="gallery"> <% shoe.photos.each do |photo| %> <%= link_to image_tag(photo.photo_file.url(:thumb).to_s), photo.photo_file.url.to_s, :class => 'fancybox', :rel => 'gallery' %> <% end %> </div> </div> <% end %> Outputs this: <div class="shoe"> <div class="gallery"> <a class="fancybox" href="../nike-kd-6-meteorology-2.jpg" rel="gallery"> <img src="../thumb_nike-kd-6-meteorology-2.jpg"> </a> <a class="fancybox" href="../nike-kd-6-meteorology-2.jpg" rel="gallery"> <img src="../thumb_nike-kd-6-meteorology-2.jpg"> </a> <a class="fancybox" href="../nike-kd-6-meteorology-2.jpg" rel="gallery"> <img src="../thumb_nike-kd-6-meteorology-2.jpg"> </a> </div> </div> But I want the first image of each gallery to be able to have its own class and the rest of the images to have their own class. Something like this: <a class="firstclass" href="../nike-kd-6-meteorology-2.jpg" rel="gallery"> <img src="../thumb_nike-kd-6-meteorology-2.jpg"> </a> <a class="fancybox" href="../nike-kd-6-meteorology-2.jpg" rel="gallery"> <img src="../thumb_nike-kd-6-meteorology-2.jpg"> </a> <a class="fancybox" href="../nike-kd-6-meteorology-2.jpg" rel="gallery"> <img src="../thumb_nike-kd-6-meteorology-2.jpg"> </a> How can I do this? Also I want each gallery to have its own unique id but when I try to add this: :rel => 'gallery<%= shoe.id %>' I get a Syntax error. Thanks.

    Read the article

  • MongoDB, Carrierwave, GridFS and prevention of files' duplication

    - by Arkan
    I am dealing with Mongoid, carrierwave and gridFS to store my uploads. For example, I have a model Article, containing a file upload(a picture). class Article include Mongoid::Document field :title, :type => String field :content, :type => String mount_uploader :asset, AssetUploader end But I would like to only store the file once, in the case where I'll upload many times the same file for differents articles. I saw GridFS has a MD5 checksum. What would be the best way to prevent duplication of identicals files ? Thanks

    Read the article

  • Rmagick Fails To Manipulate PNG

    - by Tyler DeWitt
    Following the Railscast episode on CarrierWave: I installed ImageMagick on Mountain Lion via homebrew, exported the following path: export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig:$PKG_CONFIG_PATH" Symlinked the following: ln -s /usr/local/include/ImageMagick/wand /usr/local/include/wand ln -s /usr/local/include/ImageMagick/magick /usr/local/include/magick And installed rmagick via bundler. In my uploader I have the following: include CarrierWave::RMagick version :thumb do process :resize_to_limit => [85, 85] end Which creates thumbnails just fine, but not for png files. I've tried a handful of png images and it always fails with this error: Failed to manipulate with rmagick, maybe it is not an image? Original Error: no decode delegate for this image format `<path>/public/uploads/tmp/20121022-2133-9885-3333/thumb_cat_vs_internet.png' @ error/constitute.c/ReadImage/544 jpeg images work just fine. EDIT identify -list format | grep -i png returns nothing, indicating the png decode delegate is probably missing. Now what?

    Read the article

  • Rails prettyPhoto does not show photo with jquery (instead redirect to photo page)

    - by dare
    i do all instruction for use prettyPhoto in https://github.com/hiq5/prettyphoto-rails. and i do this to show a single photo( not gallery ) =link_to image_tag(photo.photo_url(:thumb).to_s, :alt => photo.name ,:class => "img-polaroid"), photo.photo_url, :rel => 'prettyPhoto' but still redirect to photo url and show photo, and doesn't use jQuery to show it on the current page. i check it with chrome development tools, there isn't any error. i use haml to generate views (instead erb), and carrierwave to upload photos. by the way I use twitter bootstrap. any help is appreciated.

    Read the article

  • Rails - set POST request limit (file upload)

    - by Fabiano PS
    I am building a file uploader for Rails, using CarrierWave. I am pretty happy about it's API, except that I don't seem to be able to cut file uploads that exceed a limit on the fly. I found this plugin for validation, but the problem is that it happens after the upload is completed. It is completely unacceptable in my case, as any user could take the site down by uploading a huge file. So, I figure that the way would be to use some Rack configuration or middleware that will limit POST body size as it receives. I am hosting on Heroku, as context. *I am aware of https://github.com/dwilkie/carrierwave_direct but it doesn't solve my issue as I have to resize first and discard the original large image.

    Read the article

  • How can I store Rails uploads on a remote server (and not a common cloud host)?

    - by joshee
    I would like to store uploads from a Rails application on a different server than my application server. I want to keep costs to a minimum and host this other server in-house. I am planning to use Carrierwave for uploads. It seems Carrierwave interfaces with Fog for remote hosts. Is there a way I could set the other server to act as a Fog provider? How would I go about this setup? Or, is there some better and easier way to go about all this?

    Read the article

  • Installing gitlab on Debian 6.0.5

    - by helmus
    I am using following directions in an attempt to install gitlab on Debian 6.0.5 https://github.com/gitlabhq/gitlabhq/blob/stable/doc/installation.md I am getting an error when i'm running following command sudo -u gitlab bundle exec rake gitlab:app:setup RAILS_ENV=production WARNING: #<ArgumentError: Illformed requirement ["#<Syck::DefaultKey:0x00000004b52198> 1.1.4"]> # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = %q{carrierwave} s.version = "0.6.2" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Jonas Nicklas"] ....more error.... s.add_dependency(%q<mini_magick>, [">= 0"]) s.add_dependency(%q<rmagick>, [">= 0"]) end end WARNING: Invalid .gemspec format in '/usr/local/lib/ruby/gems/1.9.1/specifications/carrierwave-0.6.2.gemspec' Could not locate Gemfile Some pointers to what could cause this would be much appreciated, i have only little experience with RoR and it seems to be related to that.

    Read the article

  • Carrier Wave not completing upload to Rackspace Cloud Files

    - by Zack Fernandes
    Hello, I have been attempting to get file uploads to Rackspace Cloud Files online all night, and finally tried the Carrierwave Plugin. Although the plugin worked right away, when I tried viewing the file uploaded (an image) it was broken. Upon further testing, I found out that files would upload to Cloud Files, however were just a fraction of their original size. I can't seem to figure out what's worng, and any help would be greatly appreciated. My code is as follows. models\attachment.rb class Attachment < ActiveRecord::Base attr_accessible :title, :user_id, :file, :remote_file_url, :file_cache, :remove_file belongs_to :user mount_uploader :file, AttachmentUploader end uploaders\attachment_uploader.rb class AttachmentUploader < CarrierWave::Uploader::Base storage :cloud_files def store_dir "#{model.user_id}-#{model.id}" end end

    Read the article

  • Running bundle install fails trying to remote fetch from rubygems.org/quick/Marshal...

    - by dreeves
    I'm getting a strange error when doing bundle install: $ bundle install Fetching source index for http://rubygems.org/ rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems/remote_fetcher.rb:304 :in `open_uri_or_path': bad response Not Found 404 (http://rubygems.org/quick/Marshal.4.8/resque-scheduler-1.09.7.gemspec.rz) (Gem::RemoteFetcher::FetchError) I've tried bundle update, gem source -c, gem update --system, gem cleanup, etc etc. Nothing seems to solve this. I notice that the URL beginning with http://rubygems.org/quick does seem to be a 404 -- I don't think that's any problem with my network, though if that's reachable for anyone else then that would be a simple explanation for my problem. More hints: If I just gem install resque-scheduler it works fine: $ gem install resque-scheduler Successfully installed resque-scheduler-1.9.7 1 gem installed Installing ri documentation for resque-scheduler-1.9.7... Installing RDoc documentation for resque-scheduler-1.9.7... And here's my Gemfile: source 'http://rubygems.org' gem 'json' gem 'rails', '>=3.0.0' gem 'mongo' gem 'mongo_mapper', :git => 'git://github.com/jnunemaker/mongomapper', :branch => 'rails3' gem 'bson_ext', '1.1' gem 'bson', '1.1' gem 'mm-multi-parameter-attributes', :git=>'git://github.com/rlivsey/mm-multi-parameter-attributes.git' gem 'devise', '~>1.1.3' gem 'devise_invitable', '~> 0.3.4' gem 'devise-mongo_mapper', :git => 'git://github.com/collectiveidea/devise-mongo_mapper' gem 'carrierwave', :git => 'git://github.com/rsofaer/carrierwave.git' , :branch => 'master' gem 'mini_magick' gem 'jquery-rails', '>= 0.2.6' gem 'resque' gem 'resque-scheduler' gem 'SystemTimer' gem 'capistrano' gem 'will_paginate', '3.0.pre2' gem 'twitter', '~> 1.0.0' gem 'oauth', '~> 0.4.4'

    Read the article

  • how to make a web-gallery with RoR?

    - by neuro
    hello, Im a newbie RoR kid, and I'm trying to make a web gallery app just like the onyx http://www.hulihanapplications.com/projects/onyx since it's outdated and i couldn't get it to work with my 2.3.8 rails' version. So, are plugins like paperclip or carrierwave any good for me to start with. Or should i take another route and writh the app from scratch. please provide me with good links regarding the subject. thank you in advance

    Read the article

1