plz help me anyone we are writing some value to global varible in application_helper file and accessing the same in views and layouts the value of global varible changes dynamically whenever user logs in (Example if user1 and user2 logs in at same time sometimes user2 is veiwing user1 deatils in that global varible we are running the application in production mode with apache 2.x version and passeneger 2.x version ) .plz suggest us how to use global varible in this scenario
The solution is to not use global variables. It may be that session variables are appropriate for your requirement if you wish data for a user to persist across server requests. If you do not require persistence then just use instance variables.
Colin
I would say "GB2PHP" based on this, but it wouldn't work there
either...
Seriously - 99% of the time, if you're using a global variable, you're doing it wrong. Take a look at session variables in the ActionController::Base docs:
http://api.rubyonrails.org/classes/ActionController/Base.html
I'd also *strongly* recommend that you get a good (recent) Rails reference like Agile Web Development with Rails (3rd ed).
--Matt Jones