27 Apr 2013, 15:27
Generic-user-small

Manikandan sibi (2 posts)

undefined local variable or method `current_cart’ for #

Rails.root: /Users/eit/onlineshop Application Trace | Framework Trace | Full Trace

app/controllers/items_controller.rb:45:in `create’

27 Apr 2013, 15:27
Generic-user-small

Manikandan sibi (2 posts)

please help to solve this sir

27 Apr 2013, 19:15
Samr_small_pragsmall

Sam Ruby (584 posts)

I’m a bit confused as that says ‘items_controller’ instead of ‘line_items_controller’, but try adding the following to your controller:

include CurrentCart
before_action :set_cart, only: [:create]
  You must be logged in to comment