I have initialized a module in the folder "concerns" located in: appname/app/models/concerns
called current_cart.rb
appname/app/models/concerns/current_cart.rb
module CurrentCart
extend ActiveSupport::Concern
private
def set_cart
@cart = Cart.find(session[:cart_id])
rescue ActiveRecord::RecordNotFound
@cart = Cart.create
session[:cart_id] = @cart.id
end
end
i'm including this in my controller line_item_controllers:
appname/app/controllers/line_items_controller.rb
class LineItemsController < ApplicationController
include CurrentCart
but it produces this error when i try to execute on my browser:
uninitialized constant LineItemsController::CurrentCart
app/controllers/line_items_controller.rb:2:in `<class:LineItemsController>'
app/controllers/line_items_controller.rb:1:in `<top (required)>'
app/models/concernsin your load_paths?