6

I've generated a simple Rails 3 class using the scaffold function:

rails generate scaffold Fattura data:date importo:integer descrizione:text

Now I need to add another field in the class Fattura. What is the best way to do that?

Matt Gibson
  • 14,616
  • 7
  • 47
  • 79
Abramodj
  • 5,709
  • 9
  • 49
  • 75

1 Answers1

7

You can create a migration which adds a column:

rails generate migration add_my_column_to_fattura my_column:string
rake db:migrate
zetetic
  • 47,184
  • 10
  • 111
  • 119