23.8 Uploading Files to Rails Applications 23.7 Working with Nonmodel Fields
ruby script/generate model picture comment:string name:string content_type:string data:binary
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/picture.rb
create test/unit/picture_test.rb
create test/fixtures/pictures.yml
exists db/migrate
create db/migrate/20100301051840_create_pictures.rb
cp -v /home/rubys/git/awdwr/data/code/e1/views/db/migrate/*pictures.rb db/migrate/*pictures.rb
`/home/rubys/git/awdwr/data/code/e1/views/db/migrate/003_create_pictures.rb' -> `db/migrate/20100301051840_create_pictures.rb'
cp -v /home/rubys/git/awdwr/data/code/e1/views/app/models/picture.rb app/models
`/home/rubys/git/awdwr/data/code/e1/views/app/models/picture.rb' -> `app/models/picture.rb'
rake db:migrate
mv 20100301051840_create_pictures.rb 20100301000004_create_pictures.rb
(in /home/rubys/git/awdwr/work-188-235/view)
== CreatePictures: migrating =================================================
-- create_table(:pictures)
-> 0.0019s
== CreatePictures: migrated (0.0020s) ========================================
cp -vr /home/rubys/git/awdwr/data/code/e1/views/app/views/upload app/views
`/home/rubys/git/awdwr/data/code/e1/views/app/views/upload' -> `app/views/upload'
`/home/rubys/git/awdwr/data/code/e1/views/app/views/upload/show.html.erb' -> `app/views/upload/show.html.erb'
`/home/rubys/git/awdwr/data/code/e1/views/app/views/upload/get.html.erb' -> `app/views/upload/get.html.erb'
`/home/rubys/git/awdwr/data/code/e1/views/app/views/upload/save.html.erb' -> `app/views/upload/save.html.erb'
get /upload/get
23.8 Uploading Files to Rails Applications 23.7 Working with Nonmodel Fields