Possible Duplicate:
Is there any difference between:key => "value"
andkey: "value"
assignments?
key in ruby new hash
I am reading some rails code and I see a method can be called
foo(:var1 => 'hello', :var2 => 'world')
or
foo(var1: 'hello', var2: 'world')
Both seems to work exactly the same. Is there any difference? Which is the better practice?