Ruby 1.9 supports a JavaScript-ish Hash syntax so this:
resources :foobar, except: 'create'
is the same as this:
resources :foobar, :except => 'create'
The new syntax has limitations though:
- The Hash key must be a symbol.
- The key can't be something that you'd normally quote so you can't use it for symbols like
:'this.that'
.
- You can't use it with symbols such as
:$set
(which appear all over the place if you're using MongoDB).
I'm not sure what the exact restrictions are as I don't use it (I do a fair bit of MongoDB work and I have a thing for consistency) but I think the symbols need to match /^[a-z_]\w*/i
(or technically, anything that can be used as a label) to be used with the new format.