4

I try to add new column into existing model in rubyonrails. How can I add single or multiple field into my existing model.

1 Answers1

2

if you want to add a new column then

run rails generator with Add[column]To[model] format followed by column

$ rails g migration AddBioToNameOfModels bio:text
invoke  active_record
create    db/migrate/YYYYMMDDHHMMSS_add_bio_to_name_of_models.rb

then run

rake db:migrate