The best solution to keep files in database (Rails) -


i know best way save binary files 'in database'. of course on disk files, need 'link' them in db. great solutions?

use paperclip attach file model.

say have mortgage has document

class mortgage < activerecord::base   has_attached_file :document end 

later:

mortgage = mortgage.find(params[:id]) document = mortgage.document 

paperclip used images, works types of files. can store on s3 well.


Comments

Popular posts from this blog

c++ - Compiling static TagLib 1.6.3 libraries for Windows -

PostgreSQL 9.x - pg_read_binary_file & inserting files into bytea -

jtree - comparing two TreeNode (or DefaultMutableTreeNode) objects in Java Comparator -