Sunday, August 28, 2011

[Rails] Class Variable

Hi everyone,

I have a question about class variable in Rails:

I have a class Point that contains an class variable
@@color_points="green"

In a first web Page I want to set up this variable, hence i do
Point.color_points = "green" then i test it using puts
Point.color_points ( = green, it works,yes!)
Then i have a link_to instruction that points to another web page.
On this one (the other one), I just want to print Point.color_points,
but now its value is "".

DOes anyone know why and could explain me?

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate