On 17 May 2010 02:50, Orient Fang <[email protected]> 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/app/models/cart.rb:14: syntax error,
> unexpected kEND, expecting $end
>...
> **** 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
> --

Are you absolutely certain that is the right cart.rb?  Is that the
complete file?  It looks ok to me.

Colin

-- 
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.

Reply via email to