I've set up an application using mongoDB (mongoid) where I'm logging users in with omniauth-twitter.
I need people to be able to upload images, but I can't find any good tutorials for doing this on a mongoDB. I've looked far and wide, but nobody seems to have made one yet.
Do you have any links?
I'm not sure what your issue is here. Carrierwave handles mongoid through carrierwave-mongoid. If it doesn't suit you, paperclip handles mongoid, too, without hassle.
You can go to Rails Cast for Rails tutorials. The one I linked to explains paperclip ,doubt it will explain using it with mongoid.
Related
Specifically, I would like to allow a user to upload up to 5 images. Any direction to a simple tutorial would be greatly appreciated. Ideally the data for the uploaded file would be stored in an existing database. I have tried paperclip, but I can't seem to get it to work with multiple files. I've also tried some other tutorials from 2008 that don't seem to work w/ rails 3.Thanks for the help!
I would prefer direction of tutorials that you have tried and worked.
Since I had the same problem yesterday, I wrote a tutorial about it: http://blog.powpark.com/2013/10/16/multiple-file-upload-with-html5-and-rails-admin/
I think one of the most popular file-upload gems is Carrierwave (https://github.com/carrierwaveuploader/carrierwave). There is also a demo app (https://github.com/kdironside/carrierwave-multi-file-upload) that specifically demonstrates uploading multiple files.
However, it's certainly possible to accomplish the same thing with Paperclip. Perhaps you can let us know what problem you ran into specifically, and we can help you out there.
I've decided to start wrapping my head around Rails 3 by trying to build a website with it. I'm very new to it, and really I'm just looking for advice on how to get started. I've asked questions on here before and been asked "What have you already tried?", and in this case I've tried following a couple of tutorials I've found online, but they've all been for Rails 1 or 2, and there seems to be some differences in 3 I don't understand.
As for why I'm set on using Rails 3 and not 1 or 2 - it's to get up to speed at work, I've so far concentrated on front end development, but want to start branching out and doing more complex stuff.
What I want this site to do is allow a user to upload an image that is then displayed as a list item on the home page (later I'll add lightbox and stuff to it, but I figure that'll be easy to sort out).
Any advice or pointers to advice would be greatly appreciated.
Cheers!
File uploads in Rails are fairly well documented but as you've mentioned, a lot of the tutorials online are based around Rails 2.x.
If you're just starting out, I would recommend using either paperclip or CarrierWave to handle file uploads in a Rails app. Both projects are really good but I think you'll find that CarrierWave is more flexible in the long run.
Also, as a beginner to Rails, you might also want to checkout Ryan Bates' RailsCasts which are just an incredible resource for all things Rails. In fact, both CarrierWave and Paperclip file uploads are covered in the episodes. I've provided the links below.
#253 - CarrierWave File Uploads - this is Rails 3 specific.
#134 - Paperclip - Rails 2 but the information provided here along with the README on the projects GitHub page should provide you with the information you require.
This railscast is honestly all you need: http://railscasts.com/episodes/253-carrierwave-file-uploads
It will use Carrierwave for uploading and RMagick for image processing.
Lastly: nobody reasonable is going to recommend Rails 1 or 2 at this point. Just start with 3.2.5 and be good.
I've created a RoR application, and I've got everything set up except for storing photos. I was wondering how I would accomplish this?
I've heard that Amazon S3 is the way to go and there is a nice gem called paperclip that works great with S3, however paperclip is meant for SQL based DB systems and I'm using MongoDB. Any help would be greatly appreciated!
I'm tackling the exact same problem. S3 easy and straight forward. In the throws of coding now so can't attest to reliability from Rails side but my research led me to Carrierwave https://github.com/jnicklas/carrierwave over Paperclip. There's a Railscast (Episode #253) to help get you started.
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
Paperclip is good way to start when it comes to any kind of images you'll add during runtime. You do have to install ImageMagick to change images into various sizes (thumbnails, etc), and it wouldn't be taking very long to create a webgallery with it (took me a day to figure it out).
http://www.cordinc.com/blog/2009/04/multiple-attachments-with-vali.html
I am building my first Ruby on Rails app which is going to be my own little community.
I have made the User model with several fields and information.
Now I am thinking of adding avatar support for the users. I've been researching and found that my best option would be using Paperclip, but then I encountered a little dilemma.
I want my users to be able to resize/crop their avatar image after they have chosen a image.
I have Googled a lot and since i am using jQuery i found that imgAreaSelect would be best in my opinion. And i think MiniMagick looks best.
So to my question. How can I best integrate Paperclip and imgAreaSelect?
I am new to Ruby and Rails so i don't know how i can resize the image.
Do you folks know how to integrate the to or maybe some other options that fits my needs best?
Ryan Bates covered cropping images using Paperclip and JCrop in Railscast 182. I'd recommend that you check it out.