Subscribe to my Feed, follow me on Twitter, recommend me on Working With Rails or see my code on GitHub
ActsAsFile: Simple file storage plugin
ActsAsFile will save files attached to a model in a specified directory on the file system. It will add validation errors on the model if the file can’t be saved. And.. I think that’s it. As I said, it’s simple, and I like simple. Read more about it here.
class UploadedFile < ActiveRecord::Base
acts_as_file
self.save_path = File.join(RAILS_ROOT, 'public', 'uploads')
self.read_path = 'uploads'
end
