7stud -- wrote:
> private
> def find_cart
> session[:cart] ||= Cart.new
> end
If I change that method to:
def find_cart
Cart.new
end
then clicking on an "add to cart" button no longer shows me the error
message. I get a view that lists what was added to the cart. However,
without sessions the view just shows the current item that is being
added.
As soon as I add back the line that mentions sessions:
> private
> def find_cart
> session[:cart] ||= Cart.new
> end
I get the error message.
I tried rolling back the migration again:
rake db:rollback
then deleting the migration file:
/depot/db/migrate$ 20090423153751_create_sessions.rb
then recreating the migration file:
/depot$ rake db:sessions:create
and recreating the table:
/depot$ rake db:migrate
then restarting the server. But that did not solve my problem.
--
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
-~----------~----~----~----~------~----~------~--~---