7stud -- wrote:
>
> Sorry, I can access the store page. It's when I click a button that
> calls an add_to_cart action that I get that error message. This is the
> url after I click on the add_to_cart button:
>
> http://localhost:3000/store/add_to_cart/5
Here is the add_to_cart action:
class StoreController < ApplicationController
def index
@products = Product.find_products_for_sale
now = Time.now
@date = now.strftime("%m/%d/%Y")
@time = now.strftime("%I:%M%p")
end
def add_to_cart
product = Product.find(params[:id])
@cart = find_cart
@cart.add_product(product)
end
private
def find_cart
session[:cart] ||= Cart.new
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
-~----------~----~----~----~------~----~------~--~---