Skip to content

Instantly share code, notes, and snippets.

@pikender
Last active April 12, 2016 16:26
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save pikender/52c5f30c74f1a2bbff886e6ffcc6be46 to your computer and use it in GitHub Desktop.
Phoenix Router Extension
defmodule Nectar.ExtendRouter do
defmacro mount do
quote do
get "/favorites", FavoriteProducts.FavoriteController, :index
end
end
end
defmodule Nectar.Router do
...
# Add Route Here
# get "/favorites", FavoriteProducts.FavoriteController, :index
require Nectar.ExtendRouter
Nectar.ExtendRouter.mount
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment