small medium large xlarge

Generic-user-small
23 May 2015, 20:17
liroy l (1 post)

Through the Depot Example I built a nice platform, skipped the Ajax part (since I didn’t want my cart there) but still created the partials (_cart,_line_item). Anyways, when I start working on the Orders section and run the scaffold, and migrate I get 45 errors stating “ActiveRecord::StatementInvalid: Could not find table ‘line_items’” and “NoMethodError: undefined method `each’ for nil:NilClass” any ideas?? Thanks a lot!

Generic-user-small
05 Jan 2016, 23:20
Ronald Mundell (1 post)

I had the same issue, look at the following

1) on page 159, make sure that you have entered “rails generate migration add_order_to_line_item order:references” correctly, my problem was that I left the s off “:references”. if you have done the same, do the following, a) rails destroy migration add_order_to_line_item b) rails generate migration add_order_to_line_item order:references c) rake db:migrate:reset d) rake db:seed

Hope this help

You must be logged in to comment