-1

I'm new in Ruby/Rails, so, my question: what is the perfect way to upload file and save filename in database with rails? Are there any Gem? Or maybe there are good build-in feature?

Mark Pegasov
  • 5,109
  • 9
  • 26
  • 30
  • I'm amazed of how many people ask this same exact question without searching SO first...... – stfcodes Mar 30 '12 at 11:40
  • possible duplicate of [Rails 3 paperclip vs carrierwave vs dragonfly vs attachment\_fu](http://stackoverflow.com/questions/7419731/rails-3-paperclip-vs-carrierwave-vs-dragonfly-vs-attachment-fu) – Puce Feb 25 '15 at 11:05

4 Answers4

7

Also try carrierwave, Ryan has a good screencast about this gem

Said Kaldybaev
  • 9,380
  • 8
  • 36
  • 53
3

Just take a look on the links to choose between paperClip & carrierwave :

Rails 3 paperclip vs carrierwave vs dragonfly vs attachment_fu

And

http://bcjordan.github.com/posts/rails-image-uploading-framework-comparison/

Community
  • 1
  • 1
Vik
  • 5,931
  • 3
  • 31
  • 38
2

You can try Paperclip.It is most popular gem in rails community...

   https://github.com/thoughtbot/paperclip

these lines do the all stuff

   class User < ActiveRecord::Base
     has_attached_file :avatar, :styles => { :medium => "300x300>", :thumb => "100x100>" }
   end

Try it......

Kashiftufail
  • 10,815
  • 11
  • 45
  • 79
1

Most people use the Paperclip Gem.

sosborn
  • 14,676
  • 2
  • 42
  • 46