Reputation: 735
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!
Upvotes: 1
Views: 2756
Reputation: 11580
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.
Upvotes: 2
Reputation: 40277
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.
Upvotes: 1