The strip! method modifies the variable directly. Calling strip (without the !) returns a copy of the variable with the modifications, the original variable is not altered.
@name is an instance variable and @@name is a class variable
Rails will report errors from Apache in log/apache.log and errors from the Ruby code in log/development.log. If you're having a problem, do have a look at what these logs are saying. On Unix and Mac OS X you may run tail -f log/development.log in a separate terminal to monitor your application's execution.
A class variable starts with an @@ sign which is immediately followed by upper or lower case letter. You can also put some name characters after the letters which stand to be a pure optional. A class variable can be shared among all the objects of a class. A single copy of a class variable exists for each and every given class.
To write a global variable you start the variable with a $ sign which should be followed by a name character. Ruby defines a number of global variables which also include other punctuation characters such as $_ and $-k.
For example: If you declare one variable as global we can access any where, where as class variable visibility only in the classÂ Example
Â $a = 5
Â @b = 4
while $a > 0
$a= $a - 1
test = Test.new
puts $aÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â # 5
puts @bÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â #nil
The main Symbol let the start_tabnav method know to look for a special MainTabnav class where all the magic happens