small medium large xlarge

Generic-user-small
06 Dec 2011, 10:30
shaoyihe (1 post)

118 page:

def current_cart
Cart.find(session[:cart_id])
rescue ActiveRecord::RecordNotFound
cart = Cart.create                   #this line didnot work
session[:cart_id] = cart.id
cart
end

i test,then i get wrong message. here:

NoMethodError in StoreController#index

undefined method `attributmn_definitiones_from_colu’ for # Rails.root: E:/ruby/project/depot

Application Trace | Framework Trace | Full Trace app/controllers/application_controller.rb:19:in rescue in current_cart' app/controllers/application_controller.rb:17:in current_cart’ app/controllers/store_controller.rb:11:in `index’

so what’s wrong? thanks.

my rails environment:

C:\Users\wubuqilai>ruby -v ruby 1.9.2p290 (2011-07-09) [i386-mingw32]

C:\Users\wubuqilai>rails -v Rails 3.1.1

C:\Users\wubuqilai>gem -v 1.7.2

Generic-user-small
04 Jan 2012, 04:56
Eric Rykwalder (6 posts)

If you’re still having this problem, can you post the contents of the db/schema.rb file as well as the Cart model.

You must be logged in to comment