Last active
August 29, 2015 14:12
-
-
Save eezis/4cf8600086531157ce2d to your computer and use it in GitHub Desktop.
phoenix docs question
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
Are templates scoped to a controller by naming convention? And is that convention two layers deep | |
and implemented with filenames? | |
First convention describes rules for a controller's filename; stipulating that Controller filenames | |
get two parts seperated by | |
an underscore. An application with these three controllers -- PageController, HelloController, and | |
UserController -- should manifest the following file names: | |
controllers | |
|- page_controller.ex | |
|- hello_controller.ex | |
|- user_controller.ex | |
The second layer completes the association between the Controller and their respective file names by | |
stashing templates under a template subdirectory named after the first part of the controller name as | |
follows below: | |
templates | |
|- page | |
| index.html.eex | |
| file(1..n).html.eex | |
|- hello | |
| index.html.eex | |
| file(1..n).html.eex | |
|- user | |
| index.html.eex | |
| file(1..n).html.eex | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment