Apr 19, 2008
Generic-user-small Sebastien Lamy 2 posts

Topic: Advanced Rails Recipes / Sessions won't persist after setting session_domain

Hi, I saw a message related to this topic here
I tried this recipe but it didn’t work for me (I don’t know if it camed from the fact my main host was localhost at the moment testing this recipe).

The trick given on the post I link to worked for me, but only for domain with a dot inside (eg:not for localhost). I just aliased localhost.fr in /etc/host, and everything worked fine for development.

 
Oct 21, 2007
Generic-user-small Sebastien Lamy 2 posts

Topic: Agile Web Development with Rails / The Depot Application

I saw a message of Fora User telling there was a lot of problem with the

cart_item == @current_item
in the cart_item.rhtml file, when enabling ajax (p.139 if the french version).

The poster resolved the problem by replacing the == by the .equal method, wich is never overidden.

This problem comes clearly from the fact that his CartItem class inherit ActiveRecord Class (this is because he generated his “cart_item.rb” file using the model script generator). So as this poster noticed, the == operator was overidden and caused error. ActiveRecord objects suppose there are records corresponding to the Class in the database, and this is not the case for our CartItem class

The CartItem class should not inherit from another class, and everything will be fine. So if you have this problem, check your cart_item.rb file in your models

2 posts