0

I'm new to rails trying to modify a model generated by scaffolding in rails 3. It seems like the old way is to use a script/generate command:

ruby script/generate migration add_fieldname_to_tablename fieldname:string //old way??

But when I try the old command it no longer works.

Since you longer use the ruby script/generate command to create a model I'm assuming the syntax to modify a model has changed also. What command should I use ?

Community
  • 1
  • 1
bernie2436
  • 22,841
  • 49
  • 151
  • 244

1 Answers1

2

Use rails generate migration/model/scaffold.

Using your example: rails generate migration add_fieldname_to_tablename fieldname:string

Pedro Nascimento
  • 13,136
  • 4
  • 36
  • 64
  • thanks. Does that command take any arguments? I am trying to add a Price column to a table called products. – bernie2436 Dec 31 '11 at 17:54
  • @akh2103 The example shows arguments, it can take the field name and type, which sounds like what you're asking. – Dave Newton Dec 31 '11 at 17:56