I added a new column called level to my table called ClassRequest, ran a rake db:migrate on localhost and the view worked perfectly. Pushed the changes to heroku and the view met an error "NoMethodError: undefined method `level' for #"
So I ran heroku run rake db:migrate and that appears to be successful, showing the codes below.
Running rake db:migrate attached to terminal... up, run.1
== AddDetailsToClassRequests: migrating ======================================
-- add_column(:class_requests, :level, :string)
-> 0.0684s
== AddDetailsToClassRequests: migrated (0.0713s) =============================
But when I load the associated view, I still have this error "NoMethodError: undefined method `level' for #".
I'm new to rails so I don't know what's wrong, nor how do I know how to check what may have gone wrong.
heroku restart
Check the heroku's docs: https://devcenter.heroku.com/articles/rake
After running a migration you’ll want to restart your app with heroku restart to reload the schema and pickup any schema changes.
You need to restart you app after you've run the migration. Try
heroku restart
and see if things improve.
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