Running the scaffold_resource generator outputs usage information as
follows:
% ./script/generate scaffold_resource
Usage: ./script/generate scaffold_resource ModelName [field:type,
field:type]
<snip>
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
migration:
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
end
end
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 (1.1.6.5848) with postgres-pr.
Dan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---