I’m working to the book and it has been a great experience so far! Just now I ran into the following error and I can’t seem to solve it:
depot/app/models/cart.rb:6: syntax error, unexpected keyword_end, expecting $end
app/controllers/application_controller.rb:7:in `current_cart' app/controllers/line_items_controller.rb:43:in `create'
File the bad stuff happens:
class ApplicationController < ActionController::Base protect_from_forgery private def current_cart Cart.find(session[:cart_id]) rescue ActiveRecord::RecordNotFound cart = Cart.create session[:cart_id] = cart.id cart end end
From what I understand something goes wrong in ending the function/file. I just cannot seem to figure out what is wrong with the code, I’ve already tried to download the file of your website but that doesn’t seem to solve the problem either.
I hope someone can help me solve the error and understand it better. Thanks.