Created
January 6, 2016 19:32
-
-
Save cjbell/b32e00aee88f705b6187 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule MyApp.Web do | |
# ... Other lines removed for brevity | |
def controller do | |
quote do | |
use Phoenix.Controller | |
alias MyApp.Repo | |
import Ecto.Model | |
import Ecto.Query, only: [from: 2] | |
import MyApp.Router.Helpers | |
import MyApp.Controllers.Helpers | |
end | |
end | |
defmacro __using__(which) when is_atom(which) do | |
apply(__MODULE__, which, []) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment