public
Description: Advanced seed data handling for Rails, combining the best practices of several methods together.
Home | Edit | New

Home

Welcome to the seed-fu wiki!

How to seed a file if you have a model that uses Paperclip:
I created a directory called ‘simages’ with the files to seed, though it could be anywhere (public/images, test/fixtures etc.). Then it’s just:


  s.logo = File.new("#{RAILS_ROOT}/simages/logo.jpg")

Last edited by marcus, Fri Jul 04 11:54:04 -0700 2008
Home | Edit | New
Versions: