1. NoMethodError in StoreController#add_to_cart
undefined method `product' for #<Product:0x4a02900>
[color=red]Reason : [/color]
Session Problem
[color=red]Solution:[/color]
clean the session and retart the server
rake db:sessions:clear
2. Cart.Item nil.object found when use the redirect_to_index
[color=red]reason:[/color]
Session not loaded by the redirect.
[color=red]Solution:[/color]
def index
@products = Product.find_products_for_sale
@cart = find_cart
end
3. Submit Button doesn't display when trail on the AJax sample
[color=red]Reason:[/color]
version problem, and the tag name is not correct
[color=red]Solution:[/color]
<%= form_remote_tag :url => { :action => :add_to_cart, :id => product } %>
<%= submit_tag "Add to Cart" %>
<%= end_form_tag %>
undefined method `product' for #<Product:0x4a02900>
[color=red]Reason : [/color]
Session Problem
[color=red]Solution:[/color]
clean the session and retart the server
rake db:sessions:clear
2. Cart.Item nil.object found when use the redirect_to_index
[color=red]reason:[/color]
Session not loaded by the redirect.
[color=red]Solution:[/color]
def index
@products = Product.find_products_for_sale
@cart = find_cart
end
3. Submit Button doesn't display when trail on the AJax sample
[color=red]Reason:[/color]
version problem, and the tag name is not correct
[color=red]Solution:[/color]
<%= form_remote_tag :url => { :action => :add_to_cart, :id => product } %>
<%= submit_tag "Add to Cart" %>
<%= end_form_tag %>