-
-
Save schrockwell/1237b7cf60ae88a12174e0d25d2ed279 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 MyAppWeb do | |
# Locate views at "lib/my_app_web/[controller]/templates/[view].html.eex | |
def view do | |
quote location: :keep do | |
use Phoenix.View, | |
root: | |
"lib/my_app/#{ | |
Regex.replace( | |
~r/View$/, | |
__MODULE__ |> Module.split() |> Enum.slice(1..-1) |> Enum.join("."), | |
"" | |
) | |
|> Macro.underscore() | |
}/templates", | |
path: "", | |
namespace: MyAppWeb | |
# ... | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment