When creating a model in Rails, I forgot to add a column "strong text" that I want. How can I add it to the model later?
Asked
Active
Viewed 123 times
0
-
https://edgeguides.rubyonrails.org/active_record_migrations.html – Thilo Jul 23 '19 at 11:16
2 Answers
1
in your command line
rails g migration add_strong_text_to_model strong_text:string
and
rake db:migrate
duplicate of this

Abhishek Aravindan
- 1,432
- 6
- 23
-
-
added incase if he is a beginner. :) after all he should get confused where to add the type of column – Abhishek Aravindan Jul 23 '19 at 09:16
0
Write a migration on console/terminal
as follows:
rails g migration AddColumnToModel column_name:column_type
then run migration console/terminal
as:
rake db:migrate

404-Err
- 59
- 7