I am new to Ruby on Rails. I am trying to generate a model using the command
rails generate model Movie title:text year:integer rating:integer description:text
But I get the error :
invoke active_record The name 'Movie' is either already used in your application or reserved by Ruby on Rails. Please choose an alternative and run this generator again.
I really want to keep the name Movie. I have also tried the below to delete the table - but the table does not exists in the database
sqlite> drop table Movie;
Error: no such table: Movie
I am not sure how to fix this error or what is causing it. Any help with this would be great. Thanks in advance.
You can revert by running rails destroy model Movie
. This will remove model, migration, tests, and fixtures that have been previously generated.
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