Skip to content

Instantly share code, notes, and snippets.

@eqdw
Created December 3, 2013 22:33
Show Gist options
  • Save eqdw/7778805 to your computer and use it in GitHub Desktop.
Save eqdw/7778805 to your computer and use it in GitHub Desktop.
App.Router ->
@route "Foo" # => Route is foo, FooController, model is Foo, etc
@resource "Herp", -> # => Route is herp, HerpController, model is Herp, etc
@route "Derp" # => Route is herp.derp, HerpDerpController, model is Derp (I think)
@resource "Animal", -> # => Route is animal, AnimalController, Animal, etc
@resource "Cat", -> # => route is cat, CatController, Cat, etc. BECAUSE IT IS A
# RESOURCE IT OPENS A NEW SCOPE, instead of being (for example) AnimalCatController
@route "Meow" # => Route is cat.meow, CatMeowController, model is Meow (I think)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment