HI,
I have almost the same issue when I follow the 3rd Edtion.
but I verified the every type characters, there should be no mistakes.
Any one could help?
---------
SyntaxError in StoreController#add_to_cart
D:/InstantRails/rails_apps/lzpback/app/models/cart.rb:14: syntax error,
unexpected kEND, expecting $end
RAILS_ROOT: D:/InstantRails/rails_apps/lzpback
Application Trace | Framework Trace | Full Trace
D:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:380:in
`load_without_new_constant_marking'
D:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:380:in
`load_file'
D:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in
`new_constants_in'
D:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:379:in
`load_file'
D:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:259:in
`require_or_load'
D:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:425:in
`load_missing_constant'
D:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in
`const_missing'
D:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:in
`const_missing'
D:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:437:in
`load_missing_constant'
D:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:96:in
`const_missing'
D:/InstantRails/rails_apps/lzpback/app/controllers/store_controller.rb:19:in
`find_cart'
D:/InstantRails/rails_apps/lzpback/app/controllers/store_controller.rb:9:in
`add_to_cart'
Request
Parameters:
{"authenticity_token"=>"jp209H0whp2bnxAl+JiDhLx4clqJbMwei4Oz9eUyBwo=",
"id"=>"2"}
Show session dump
Response
Headers:
{"Content-Type"=>"",
"Cache-Control"=>"no-cache"}
**** cart.rb file as following,
--------
class Cart
attr_reader :items
def initialize
@items = []
end
def add_product(product)
current_item = @items.find {|item| item.product == product}
if current_item
current_item.increment_quantity
else
@items << CartItem.new(product)
end
end
end
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.