Reputation: 49
My app runs perfectly on my local server but returns the error below when I try to push it to heroku:
ActionView::Template::Error (undefined method 'code' for nil:NilClass)
The method 'code'
is the title of the first column in my SQLite database and is used to search for products in a search bar which are then graphed on my app.
Anyone know what could be causing this?
Upvotes: 0
Views: 975
Reputation: 14740
It's really hard to tell without seeing any code, but more than likely, somewhere you're doing
some_variable.code
and this variable is nil. What's probably happening is that you haven't added data into your production database (on Heroku) that you have in your development (local) database, which is causing this variable to be nil
on Heroku.
Upvotes: 1