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?
Scaffolding is a quick way to produce some major pieces of an application. For auto generating a set of models, views and controllers for a new resource in a single operation, scaffolding is used.
You can create a migration which adds a column:
rails generate migration add_my_column_to_fattura my_column:string
rake db:migrate
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With