You may see :symbol and symbol: used interchangeably in rails 3 and later. This was one of the most confusing things to me when I first started developing with ruby and rails until someone on the #rubyonrails irc channel (an excellent resource, by the way) explained it to me.
The difference is that a symbol with the colon before it is just a symbol (a variable). You will need a “fat arrow” after it if you are assigning something to it, like this:
# does the equals make me look fat? :class => "content"
A symbol with the colon after the name is actually the same thing as above, but includes the fat arrow in it, so you don’t have to write it. It is shorthand for the first method, written like this:
This can look a bit weird when you are assigning variables to a symbol, but it works just fine and is less code to write.
Rn Crtr is the author of devderp.com.