Forum: Ruby on Rails Re: [ocruby] iteration A1 in ebook: scaffold gets: routing e

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5acef768a932b6329d43f274dbb2a22b?d=identicon&s=25 Ray Tayek (Guest)
on 2006-06-06 16:05
(Received via mailing list)
At 02:42 AM 6/6/2006, you wrote:
>hi, on page 82 of second edition, getting stuck after

got past that, must have been doing something wrong. ended up writing
the script below:

thanks

set -x
base=i:/work
PATH=/cygdrive/$base:$PATH
name=depot
cd $base
rm -rf depot
ls
mysqladmin -f -u root drop ${name}_development
mysqladmin -u root create ${name}_development
mysqladmin -f -u root drop ${name}_test
mysqladmin -u root create ${name}_test
mysqladmin -f -u root drop ${name}_production
mysqladmin -u root create ${name}_production
echo rails
rails.cmd $name
cd $name
echo rake db:migrate
rake.bat db:migrate
echo script/generate model Product
ruby script/generate model Product
echo "edit migration file"
#read x
cat > $base/$name/db/migrate/001_create_products.rb << !!eof
class CreateProducts < ActiveRecord::Migration
   def self.up
     create_table :products do |t|
       t.column :title, :string
       t.column :description, :text
       t.column :image_url, :string
     end
   end
   def self.down
     drop_table :products
   end
end
!!eof
echo rake db:migrate
rake.bat db:migrate
mysql -u root << !!eof
use ${name}_development;
show tables;
describe products;
!!eof
echo ruby script/generate controller admin
ruby script/generate controller admin
echo edit controller
cat > $base/$name/app/controllers/admin_controller.rb << !!eof
class AdminController < ApplicationController
scaffold :product
end
!!eof
echo starting server
ruby script/server



---
vice-chair http://ocjug.org/
This topic is locked and can not be replied to.