My router currently looks like this:
scope "/", TaskAppWeb do
pipe_through([:browser])
resources("/classes", ClassController)
end
However, I want classes to be prefixed with /teacher/
So I tried to do something like this: scope "/teacher", TaskAppWeb do
.
This gets me part of the way there, because the url for creating classes now looks like this: /teacher/classes
However, I want the route teacher/
to give me a homepage for teachers. Currently I get this:
no route found for GET /teacher (TaskAppWeb.Router)
Which of course makes sense since all I did was rename the scope, but how would I actually create this new page for the /teacher scope?
The documentation shows you can do something like this:
scope "/teacher", TaskAppWeb.Teacher, as: :teacher do
But it doesn’t elaborate on how to actually hook up a page to this? Sorry if it’s self explanatory, I am still a beginner.