开发者

Edit a Rails scaffold class to add a new field

开发者 https://www.devze.com 2023-02-15 07:42 出处:网络
I\'ve generated a simple Rails 3 class using the scaffold开发者_Python百科 function: rails generate scaffold Fattura data:date importo:integer descrizione:text

I've generated a simple Rails 3 class using the scaffold开发者_Python百科 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?


You can create a migration which adds a column:

rails generate migration add_my_column_to_fattura my_column:string
rake db:migrate
0

精彩评论

暂无评论...
验证码 换一张
取 消