app/controllers/application_controller.rb
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception.
For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception . For APIs you may want to use : null_session instead .
def current_order
  	if session[:order_id].nil?
  		Order.new
  	else  		
      Order.find_by(id: session[:order_id])
  	end
  end
def current_order if session [ :order_id ] . nil? Order . new else Order . find_by ( id : session [ :order_id ] ) end end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .