I'm thinking of storing the view, what i mean by view is like this: app/views/profiles/index.html.haml into this i would do $view = self
then in other parts of my app i would use and edit the $view var.
it might get troubles?
I'm thinking of storing the view, what i mean by view is like this: app/views/profiles/index.html.haml into this i would do $view = self
then in other parts of my app i would use and edit the $view var.
it might get troubles?
Some people consider defining global variables in ruby as something very wrong. I concur. Encapsulation is very important.
Think about this for a second - when you start a rails server, global objects are stored in memory for as long as the server is running whereas when you request a php file they last only for the duration of that one request. So this means that in rails, global variables will be shared among all the users. This goes for class variables as well.
So you may never have problems in development, but when you have more than one user at the same time you could be in for some unwanted sideeffects.