bernie2436
bernie2436

Reputation: 23921

How do I modify a model generated by scaffolding using the new syntax in Ruby on Rails 3?

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 ?

Upvotes: 0

Views: 147

Answers (1)

Pedro Nascimento
Pedro Nascimento

Reputation: 13916

Use rails generate migration/model/scaffold.

Using your example: rails generate migration add_fieldname_to_tablename fieldname:string

Upvotes: 2

Related Questions