I try to add new column into existing model in rubyonrails. How can I add single or multiple field into my existing model.
Asked
Active
Viewed 3,373 times
1 Answers
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

Tanmay Agrawal
- 77
- 8