Forum: Ruby on Rails scaffold_resource doc / usage bug

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
515264ba6b2d0c63578042cbfd91ad47?d=identicon&s=25 dmack (Guest)
on 2007-01-15 19:41
(Received via mailing list)
Running the scaffold_resource generator outputs usage information as

  % ./script/generate scaffold_resource
  Usage: ./script/generate scaffold_resource ModelName [field:type,

Which seems to indicate that one would type the command with the
optional fields separated by COMMAS.  For example:

 % ./script/generate scaffold_resource Jump num:integer,
location_id:integer, description:text

This yields no errors on invocation, but it does yield a broken

class CreateJumps < ActiveRecord::Migration
  def self.up
    create_table :jumps do |t|
      t.column :num, :integer,
      t.column :location_id, :integer,
      t.column :description, :text

The commas are added to the create_table loop and break the migration
as 'rake db:migrate' demonstrates:

% rake db:migrate
(in /usr/home/foo/src/sample)
rake aborted!
./db/migrate//001_create_jumps.rb:5: parse error, unexpected tSYMBEG,
expecting kEND
      t.column :location_id, :integer,

(See full trace by running task with --trace)

The examples on the bottom of the usage page for scaffold_resource are
correct but the [field:type, field:type] text for the command line
usage seems to indicate that one should separate the fields by commas
and that does not work.

I'm using Rails 1.2RC1 ( with postgres-pr.

This topic is locked and can not be replied to.