[Rails] Re: Agile Web Dev (book) question: errors

2010-05-17 Thread frogstarr78
I copied and pasted and ran this code and it worked fine for me. Any stray "," characters? On May 16, 6:50 pm, Orient Fang wrote: > 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? > ---

Re: [Rails] Re: Agile Web Dev (book) question: errors

2010-05-17 Thread clanlaw
On 17 May 2010 02:50, Orient Fang wrote: > > 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

[Rails] Re: Agile Web Dev (book) question: errors

2010-05-16 Thread Orient Fang
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, e

[Rails] Re: Agile Web Dev (book) question: errors

2010-01-15 Thread E. Litwin
> 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) >  

[Rails] Re: Agile Web Dev (book) question: errors

2010-01-15 Thread Lee Mcalilly
I had this same problem and I find this really weird because I was using the actual code supplied by the book and was getting the error. When I added an extra "end" to the bottom of the file it worked. Can someone tell me why this code works: class Cart attr_reader :items def initialize